Image Gen — Admin

Image Generation

Generate book covers and chapter images using Cloudflare Workers AI.

{#each (['cover', 'chapter'] as const) as t} {/each}
(slugFocused = true)} onblur={() => setTimeout(() => { slugFocused = false; }, 150)} placeholder="e.g. shadow-slave" autocomplete="off" class="w-full bg-(--color-surface-2) border border-(--color-border) rounded-lg px-3 py-2 text-(--color-text) text-sm placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-(--color-brand)" /> {#if slugFocused && bookSuggestions.length > 0}
    {#each bookSuggestions as b}
  • selectBook(b)} class="flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-(--color-surface-3) transition-colors" > {#if b.cover} {:else}
    {/if}

    {b.title}

    {b.slug}

  • {/each}
{/if}
{#if selectedBook}
{selectedBook.title} {#if selectedBook.summary} {/if}
{/if}
{#if imageType === 'chapter'}
{/if}
{#if selectedModelInfo}

{selectedModelInfo.description}

{/if} {#if refWarning}

{refWarning}

{/if}
{#if slug.trim()} {/if} {#if selectedBook?.summary} {/if} {#if presets.length > 0} {/if}
{#if showPresets && presets.length > 0}
{#each presets as p}
{/each}
{/if} {#if autoPromptError}

{autoPromptError}

{/if}

Reference image (optional, img2img)

{#if selectedBook?.cover && selectedModelInfo?.supports_ref}
Use book cover
{/if}
{#if referenceFile && referencePreviewUrl}
Reference

{referenceFile.name}

{fmtBytes(referenceFile.size)}

{#if useCoverAsRef}

Current book cover

{/if}
{:else} {/if}
{#if showAdvanced}
{#if selectedModelInfo?.provider === 'cloudflare' || selectedModelInfo?.id.toLowerCase().includes('flux')}

Cloudflare Workers AI has a ~100 s timeout. High step counts on FLUX models may result in a 502 error. Keep steps ≤ 20 to stay within limits.

{/if}
{numSteps}
{guidance.toFixed(1)}
{#if referenceFile}
{strength.toFixed(2)}

0 = copy reference · 1 = ignore reference

{/if}
{/if}
{#if genError}

{genError}

{/if}

How it works

  1. Fill in the form and click Generate (async).
  2. The job is queued in the background — no waiting on this page.
  3. You'll be taken to AI Jobs to monitor progress.
  4. When done, click Review to see the image and approve or discard it.
Go to AI Jobs

Tips

  • • Use Auto-prompt to generate a prompt from the book's description.
  • • FLUX models produce high-quality covers but take 60–120 s — the async path prevents timeouts.
  • • Keep steps ≤ 20 on Cloudflare Workers AI to stay within the ~100 s limit.
  • • Reference images (img2img) only work with models that show ★ref.