Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(media): style preset picker on Image/Video gen + Codex backend in Writers Room
Adam Eivybbb6b17509ff
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 68671cd9ba..dedaac86ab 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Added+- **Style presets surfaced on Image / Video gen, expanded library, and Codex backend wired into Writers Room storyboard.** The world-style presets that previously only existed inside the Writers Room storyboard config are now available on the standalone **Image Gen** and **Video Gen** pages too — a category-grouped picker (`StylePresetPicker`) sits above each form's prompt textarea, prefixes the user's prompt with the preset's style at submit time, and appends the preset's negative-prompt to the user's negative. The library grew from 9 to **40 curated presets across four categories** — *Cinema & Photo* (cinematic, noir, photorealistic, vintage film, polaroid, golden hour, low-key dramatic), *Genre & Era* (cyberpunk neon, steampunk, dieselpunk, solarpunk, dark/high fantasy, space opera, cosmic horror, vaporwave, 80s sci-fi paperback, victorian, Wes Anderson), *Animation* (Studio Ghibli, Pixar 3D, Disney 2D classic, anime modern + 90s, claymation), and *Illustration & Comics* (graphic novel, comic book, manga B&W, watercolor storybook, oil painting, impressionist, art deco, art nouveau, ukiyo-e woodblock, concept art, pixel art, low-poly, isometric, technical blueprint, sumi-e ink wash) — every preset that nudges toward text/panel rendering aggressively negatives `text, words, letters, lettering, typography, title, logo, watermark, signature, caption, word balloon, speech bubble, sound effect` to suppress FLUX/Klein/Schnell's text-rendering gibberish. The Writers Room storyboard's Config tab gained a **Local | Codex** backend chip strip (only renders when more than one backend is configured); picking Codex routes scene renders through the `$imagegen` skill on the user's logged-in Codex session — model/steps/seed are hidden in that mode since `image_gen` picks them internally. Codex's sync response now also returns `status: 'running'` so SceneCard's UI stays in spinner state until the SSE `completed` event lands instead of flipping to `done` and 404'ing the placeholder `<img>`. New endpoint `GET /api/image-gen/style-presets` (canonical) replaces the old `/api/writers-room/style-presets`; client now caches the 40-item response with a module-level promise so navigating Image → Video → Writers Room doesn't refetch. New shared modules: `client/src/components/media/{StylePresetPicker,BackendChipStrip}.jsx`, `client/src/lib/{composeStyledPrompt,imageGenBackends}.js`. Touched: `server/lib/writersRoomStylePresets.js`, `server/routes/{imageGen,writersRoom}.js`, `server/services/imageGen/codex.js`, `client/src/pages/{ImageGen,VideoGen}.jsx`, `client/src/components/writers-room/StoryboardPanel.jsx`, `client/src/services/{apiSystem,apiWritersRoom}.js`.+- **Writers Room — tabbed sidebar (Characters | World | Scenes | Boards | Config), top progress strip, and "Stop all" cancel for in-flight scene renders.** The right column was a single-purpose Storyboard pane with the bibles hidden behind drawer overlays from the work overflow menu — clicking "Refresh Characters" closed the menu and hid the only spinner, so users couldn't tell whether anything was happening. Replaced with a 5-tab sub-nav: **Characters** and **World** render their bibles inline with a top "Refresh from prose" button (with running spinner per-button); **Scenes** is the prose-derived outline (clickable rows jump to that segment in the textarea); **Boards** keeps the existing storyboard scene cards; **Config** consolidates the gear-icon's Adapt LLM picker, World style, and image-gen settings. A status strip ("Refreshing characters…") sits below the tab nav whenever any analysis runs — visible from any tab even after the overflow menu closes. Each tab's icon shows a spinner when its kind is the running one. Adapt auto-jumps to the Boards tab when it starts. Long queues of auto-generated scene images can now be aborted: when one or more scenes are rendering, a banner appears above the cards ("Rendering N scenes…") with a red **Stop all** button — clicking it POSTs `/api/image-gen/cancel { all: true }` (queued cancel before running so the slot doesn't refill mid-loop), then iterates each running scene's imperative ref and calls `cancel()` to roll local state back to idle (idempotent — handles the race where the cancellation `image-gen:failed` socket event arrives first and flips the card to `error`). Per-card unmount cleanup in `onRunningChange` prevents stale entries inflating the count if a scene disappears mid-render. Touched: `client/src/components/writers-room/{StoryboardPanel,WorkEditor,SceneCard,CharactersBible,SettingsBible}.jsx`, `client/src/services/apiImageVideo.js`, `server/routes/imageGen.{js,test.js}`.- **Writers Room — 3-step storyboard setup (Characters → Settings → Adapt) replaces the lone "Run Adapt" CTA.** A fresh story used to greet the user with a single "Run Adapt" button, but Adapt's quality depends on the character + setting bibles being populated first (otherwise the LLM re-improvises descriptions every scene, breaking visual continuity). The empty-state CTA now shows a guided 3-step panel: each step has a status pill (numbered → spinner → green check), its own `Run characters` / `Run settings` / `Run Adapt` button, and a prominent `Run all in order →` master action that fires the sequential pipeline (`runFullPipeline`) so the user can one-click the whole flow. Once Adapt has run, a separate `BiblesMissingNotice` banner shows above the scenes if either bible is empty, with inline "Extract characters" / "Extract settings" buttons — so users who ran Adapt before populating bibles get a clear path to fix the visual drift without leaving the panel. `runAnalysis` now returns success/failure so the pipeline can bail on first error rather than silently chaining through a broken state. Touched: `client/src/components/writers-room/{StoryboardPanel,WorkEditor}.jsx`.diff --git a/client/src/components/media/BackendChipStrip.jsx b/client/src/components/media/BackendChipStrip.jsxnew file mode 100644index 0000000000..7d7970e827--- /dev/null+++ b/client/src/components/media/BackendChipStrip.jsx@@ -0,0 +1,38 @@+// Pill-style backend selector shared by ImageGen, VideoGen, and the Writers+// Room storyboard config. `size="md"` matches the standalone Image Gen+// page; `size="sm"` matches the storyboard's denser config tab.++const SIZES = {+ sm: 'px-2 py-0.5 text-[10px]',+ md: 'px-2.5 py-1 text-xs',+};++export default function BackendChipStrip({+ availableBackends,+ value,+ onChange,+ disabled = false,+ size = 'md',+ ariaLabel = 'Backend',+ titlePrefix = 'Use',+}) {+ if (!availableBackends?.length) return null;+ const sizeCls = SIZES[size] || SIZES.md;+ return (+ <div className="inline-flex items-center gap-1 p-0.5 border border-port-border rounded-full bg-port-bg" role="group" aria-label={ariaLabel}>+ {availableBackends.map(({ id, label, icon: Icon }) => (+ <button+ key={id}+ type="button"+ onClick={() => onChange?.(id)}+ disabled={disabled}+ className={`inline-flex items-center gap-1 rounded-full transition-colors disabled:opacity-50 ${sizeCls} ${value === id ? 'bg-port-accent text-white' : 'text-gray-400 hover:text-white hover:bg-port-border/40'}`}+ title={`${titlePrefix} ${label}`}+ >+ <Icon className="w-3 h-3" />+ {label}+ </button>+ ))}+ </div>+ );+}diff --git a/client/src/components/media/StylePresetPicker.jsx b/client/src/components/media/StylePresetPicker.jsxnew file mode 100644index 0000000000..110aeca13d--- /dev/null+++ b/client/src/components/media/StylePresetPicker.jsx@@ -0,0 +1,87 @@+import { useEffect, useMemo, useState } from 'react';+import { Palette, X } from 'lucide-react';+import { listImageStylePresets } from '../../services/apiSystem';++export default function StylePresetPicker({+ value,+ onChange,+ disabled = false,+ className = '',+ label = 'Style preset',+}) {+ const [presets, setPresets] = useState([]);++ useEffect(() => {+ let cancelled = false;+ listImageStylePresets().then((list) => {+ if (cancelled) return;+ setPresets(Array.isArray(list) ? list : []);+ }).catch(() => {});+ return () => { cancelled = true; };+ }, []);++ const grouped = useMemo(() => {+ const map = new Map();+ for (const p of presets) {+ const cat = p.category || 'Other';+ if (!map.has(cat)) map.set(cat, []);+ map.get(cat).push(p);+ }+ return Array.from(map.entries());+ }, [presets]);++ const activePreset = useMemo(+ () => (value ? presets.find((p) => p.id === value) : null),+ [value, presets],+ );++ const handleChange = (e) => {+ const id = e.target.value;+ if (!id) { onChange?.(null); return; }+ const preset = presets.find((p) => p.id === id);+ if (preset) onChange?.(preset);+ };++ return (+ <div className={className}>+ <div className="flex items-center justify-between mb-1">+ <label className="text-xs font-medium text-gray-400 flex items-center gap-1">+ <Palette className="w-3 h-3" /> {label}+ </label>+ {value && (+ <button+ type="button"+ onClick={() => onChange?.(null)}+ disabled={disabled}+ className="text-[10px] text-gray-500 hover:text-port-error flex items-center gap-0.5 disabled:opacity-50"+ title="Clear style preset"+ >+ <X className="w-3 h-3" /> Clear+ </button>+ )}+ </div>+ <select+ value={value || ''}+ onChange={handleChange}+ disabled={disabled || presets.length === 0}+ className="w-full bg-port-bg border border-port-border rounded-lg px-2 py-2 text-sm text-white focus:outline-none focus:border-port-accent disabled:opacity-50"+ >+ <option value="">None — use prompt as-is</option>+ {grouped.map(([cat, items]) => (+ <optgroup key={cat} label={cat}>+ {items.map((p) => (+ <option key={p.id} value={p.id} title={p.description || ''}>+ {p.label}+ </option>+ ))}+ </optgroup>+ ))}+ </select>+ {activePreset?.description && (+ <p className="mt-1 text-[10px] text-gray-500 truncate" title={activePreset.description}>+ {activePreset.description}+ </p>+ )}+ </div>+ );+}diff --git a/client/src/components/writers-room/StoryboardPanel.jsx b/client/src/components/writers-room/StoryboardPanel.jsxindex 94cea92b95..44dcd6cb98 100644--- a/client/src/components/writers-room/StoryboardPanel.jsx+++ b/client/src/components/writers-room/StoryboardPanel.jsx@@ -8,10 +8,11 @@ import toast from '../ui/Toast';import {listWritersRoomAnalyses,getWritersRoomAnalysis,- listWritersRoomStylePresets,} from '../../services/apiWritersRoom';-import { getSettings, updateSettings } from '../../services/apiSystem';+import { getSettings, updateSettings, listImageStylePresets } from '../../services/apiSystem';import { listImageModels, cancelImageGen } from '../../services/apiImageVideo';+import BackendChipStrip from '../media/BackendChipStrip';+import { deriveAvailableBackends, IMAGE_GEN_MODE } from '../../lib/imageGenBackends';import { timeAgo } from '../../utils/formatters';import useMounted from '../../hooks/useMounted';import SceneCard from './SceneCard';@@ -29,6 +30,16 @@ import {const SCRIPT_STAGE = 'writers-room-script';+function groupPresetsByCategory(presets) {+ const map = new Map();+ for (const p of presets) {+ const cat = p.category || 'Other';+ if (!map.has(cat)) map.set(cat, []);+ map.get(cat).push(p);+ }+ return Array.from(map.entries());+}+export const STORYBOARD_TAB = {CHARACTERS: 'characters',WORLD: 'world',@@ -74,7 +85,14 @@ export default function StoryboardPanel({const [imageCfg, setImageCfg] = useState(WR_IMAGE_DEFAULTS);const [models, setModels] = useState([]);const [stylePresets, setStylePresets] = useState([]);+ const [sysSettings, setSysSettings] = useState(null);const mountedRef = useMounted();+ // External SD-API doesn't emit the SSE progress that SceneCard's socket bus+ // consumes — restrict storyboard renders to Local + Codex.+ const availableBackends = useMemo(+ () => deriveAvailableBackends(sysSettings, { excludeExternal: true }),+ [sysSettings],+ );const imageStyle = work.imageStyle || EMPTY_IMAGE_STYLE;const activeDraft = (work.drafts || []).find((d) => d.id === work.activeDraftVersionId);@@ -84,10 +102,11 @@ export default function StoryboardPanel({Promise.all([getSettings().catch(() => ({})),listImageModels().catch(() => []),- listWritersRoomStylePresets().catch(() => []),- ]).then(([sysSettings, modelList, presets]) => {+ listImageStylePresets().catch(() => []),+ ]).then(([s, modelList, presets]) => {if (cancelled) return;- setImageCfg(readWrImageSettings(sysSettings));+ setSysSettings(s);+ setImageCfg(readWrImageSettings(s));setModels(Array.isArray(modelList) ? modelList : []);setStylePresets(Array.isArray(presets) ? presets : []);});@@ -319,6 +338,7 @@ export default function StoryboardPanel({<ConfigTabimageCfg={imageCfg}models={models}+ availableBackends={availableBackends}onCfgChange={persistCfg}stylePresets={stylePresets}imageStyle={imageStyle}@@ -633,7 +653,7 @@ function BoardsTab({}// ─── Config (image gen + style + Adapt LLM) ───────────────────────────────-function ConfigTab({ imageCfg, models, onCfgChange, stylePresets, imageStyle, onStyleChange }) {+function ConfigTab({ imageCfg, models, availableBackends, onCfgChange, stylePresets, imageStyle, onStyleChange }) {return (<div className="px-3 py-3 space-y-4"><section className="space-y-1.5">@@ -651,7 +671,7 @@ function ConfigTab({ imageCfg, models, onCfgChange, stylePresets, imageStyle, on</section><section className="space-y-1.5 pt-3 border-t border-port-border"><div className="text-[12px] font-semibold text-gray-200">Image generation</div>- <ImageGenSettingsRow cfg={imageCfg} models={models} onChange={onCfgChange} />+ <ImageGenSettingsRow cfg={imageCfg} models={models} availableBackends={availableBackends} onChange={onCfgChange} /></section></div>);@@ -966,11 +986,13 @@ function WorldStyleRow({ value, presets, onChange }) {className="w-full bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200"><option value={STYLE_ID.NONE}>None — use scene visualPrompt only</option>- <optgroup label="Presets">- {presets.map((p) => (- <option key={p.id} value={p.id}>{p.label}</option>- ))}- </optgroup>+ {groupPresetsByCategory(presets).map(([cat, items]) => (+ <optgroup key={cat} label={cat}>+ {items.map((p) => (+ <option key={p.id} value={p.id}>{p.label}</option>+ ))}+ </optgroup>+ ))}<option value={STYLE_ID.CUSTOM}>Custom</option></select>{value.presetId !== STYLE_ID.NONE && (@@ -1016,27 +1038,52 @@ const RES_PRESETS = [{ label: '1024×1024 (1:1)', width: 1024, height: 1024 },];-function ImageGenSettingsRow({ cfg, models, onChange }) {+function ImageGenSettingsRow({ cfg, models, availableBackends = [], onChange }) {const presetMatch = RES_PRESETS.find((p) => p.width === cfg.width && p.height === cfg.height);const currentModel = models.find((m) => m.id === cfg.modelId);const inputCls = 'w-full mt-0.5 bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200 focus:border-port-accent outline-none';const labelCls = 'text-[9px] uppercase tracking-wider text-gray-500';+ // Codex's built-in image_gen tool picks model/steps/seed internally — hide+ // those knobs in codex mode so the user doesn't tune values that won't apply.+ const isCodexMode = cfg.mode === IMAGE_GEN_MODE.CODEX;return (<div className="space-y-1.5">+ {availableBackends.length > 1 && (+ <div>+ <span className={labelCls}>Backend</span>+ <div className="mt-0.5">+ <BackendChipStrip+ availableBackends={availableBackends}+ value={cfg.mode}+ onChange={(id) => onChange({ ...cfg, mode: id })}+ size="sm"+ ariaLabel="Image gen backend"+ titlePrefix="Render storyboard scenes via"+ />+ </div>+ {isCodexMode && (+ <p className="text-[9px] text-gray-500 mt-1">+ Codex's <code className="text-gray-400">$imagegen</code> skill renders via your logged-in Codex session. Model, steps, and seed are picked by Codex itself.+ </p>+ )}+ </div>+ )}<div className="grid grid-cols-2 gap-1.5">- <label className="block">- <span className={labelCls}>Image model</span>- <select- value={cfg.modelId}- onChange={(e) => onChange({ ...cfg, modelId: e.target.value })}- className={inputCls}- >- {models.length === 0 && <option value={cfg.modelId}>{cfg.modelId}</option>}- {models.map((m) => (- <option key={m.id} value={m.id}>{m.name || m.id}</option>- ))}- </select>- </label>+ {!isCodexMode && (+ <label className="block">+ <span className={labelCls}>Image model</span>+ <select+ value={cfg.modelId}+ onChange={(e) => onChange({ ...cfg, modelId: e.target.value })}+ className={inputCls}+ >+ {models.length === 0 && <option value={cfg.modelId}>{cfg.modelId}</option>}+ {models.map((m) => (+ <option key={m.id} value={m.id}>{m.name || m.id}</option>+ ))}+ </select>+ </label>+ )}<label className="block"><span className={labelCls}>Resolution</span><select@@ -1055,41 +1102,43 @@ function ImageGenSettingsRow({ cfg, models, onChange }) {</select></label></div>- <div className="grid grid-cols-2 gap-1.5">- <label className="block">- <span className={labelCls}>- Steps {currentModel?.steps && <span className="normal-case text-gray-600">(default {currentModel.steps})</span>}- </span>- <input- type="number" min={1} max={150}- value={cfg.steps}- onChange={(e) => onChange({ ...cfg, steps: e.target.value })}- placeholder={String(currentModel?.steps || 'auto')}- className={inputCls}- />- </label>- <label className="block">- <span className={labelCls}>Seed</span>- <div className="flex items-stretch gap-1 mt-0.5">+ {!isCodexMode && (+ <div className="grid grid-cols-2 gap-1.5">+ <label className="block">+ <span className={labelCls}>+ Steps {currentModel?.steps && <span className="normal-case text-gray-600">(default {currentModel.steps})</span>}+ </span><input- type="number"- value={cfg.seed}- onChange={(e) => onChange({ ...cfg, seed: e.target.value })}- placeholder="random"- className="flex-1 bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200 focus:border-port-accent outline-none"+ type="number" min={1} max={150}+ value={cfg.steps}+ onChange={(e) => onChange({ ...cfg, steps: e.target.value })}+ placeholder={String(currentModel?.steps || 'auto')}+ className={inputCls}/>- <button- type="button"- onClick={() => onChange({ ...cfg, seed: randomSeed() })}- className="px-1.5 text-gray-500 hover:text-port-accent border border-port-border rounded"- title="Randomize seed"- aria-label="Randomize seed"- >- <Dice5 size={11} />- </button>- </div>- </label>- </div>+ </label>+ <label className="block">+ <span className={labelCls}>Seed</span>+ <div className="flex items-stretch gap-1 mt-0.5">+ <input+ type="number"+ value={cfg.seed}+ onChange={(e) => onChange({ ...cfg, seed: e.target.value })}+ placeholder="random"+ className="flex-1 bg-port-bg border border-port-border rounded px-2 py-1 text-[11px] text-gray-200 focus:border-port-accent outline-none"+ />+ <button+ type="button"+ onClick={() => onChange({ ...cfg, seed: randomSeed() })}+ className="px-1.5 text-gray-500 hover:text-port-accent border border-port-border rounded"+ title="Randomize seed"+ aria-label="Randomize seed"+ >+ <Dice5 size={11} />+ </button>+ </div>+ </label>+ </div>+ )}</div>);}diff --git a/client/src/lib/composeStyledPrompt.js b/client/src/lib/composeStyledPrompt.jsnew file mode 100644index 0000000000..1239600def--- /dev/null+++ b/client/src/lib/composeStyledPrompt.js@@ -0,0 +1,17 @@+// Compose user prompt + negative with an optional style preset.+// Preset prompt prefixes the user prompt — diffusion models weight earlier+// tokens heaviest, so the broad aesthetic carries over the user's content.+// Preset negative appends to user negative so user-specified avoids stay+// first-class.++export function composeStyledPrompt(userPrompt, userNegative, preset) {+ const prompt = (userPrompt || '').trim();+ const negative = (userNegative || '').trim();+ if (!preset) return { prompt, negativePrompt: negative };+ const stylePart = (preset.prompt || '').trim();+ const styleNeg = (preset.negativePrompt || '').trim();+ return {+ prompt: stylePart ? `${stylePart}. ${prompt}` : prompt,+ negativePrompt: [negative, styleNeg].filter(Boolean).join(', '),+ };+}diff --git a/client/src/lib/imageGenBackends.js b/client/src/lib/imageGenBackends.jsnew file mode 100644index 0000000000..3b06e5ed3f--- /dev/null+++ b/client/src/lib/imageGenBackends.js@@ -0,0 +1,21 @@+import { Cpu, Terminal, Cloud } from 'lucide-react';++export const IMAGE_GEN_MODE = { LOCAL: 'local', CODEX: 'codex', EXTERNAL: 'external' };++const META = {+ [IMAGE_GEN_MODE.LOCAL]: { label: 'Local', icon: Cpu },+ [IMAGE_GEN_MODE.CODEX]: { label: 'Codex', icon: Terminal },+ [IMAGE_GEN_MODE.EXTERNAL]: { label: 'External', icon: Cloud },+};++export function deriveAvailableBackends(settings, { excludeExternal = false } = {}) {+ const ig = settings?.imageGen || {};+ const out = [];+ if ((ig.local?.pythonPath || '').trim())+ out.push({ id: IMAGE_GEN_MODE.LOCAL, ...META[IMAGE_GEN_MODE.LOCAL] });+ if (ig.codex?.enabled === true)+ out.push({ id: IMAGE_GEN_MODE.CODEX, ...META[IMAGE_GEN_MODE.CODEX] });+ if (!excludeExternal && (ig.external?.sdapiUrl || ig.sdapiUrl || '').trim())+ out.push({ id: IMAGE_GEN_MODE.EXTERNAL, ...META[IMAGE_GEN_MODE.EXTERNAL] });+ return out;+}diff --git a/client/src/pages/ImageGen.jsx b/client/src/pages/ImageGen.jsxindex 2517620536..6c8eadc5a7 100644--- a/client/src/pages/ImageGen.jsx+++ b/client/src/pages/ImageGen.jsx@@ -14,13 +14,17 @@ import Drawer from '../components/Drawer';import { ImageGenTab } from '../components/settings/ImageGenTab';import MediaCard from '../components/media/MediaCard';import MediaLightbox from '../components/media/MediaLightbox';+import StylePresetPicker from '../components/media/StylePresetPicker';+import BackendChipStrip from '../components/media/BackendChipStrip';import { normalizeImage } from '../components/media/normalize';import Flux2InstallModal from '../components/imageGen/Flux2InstallModal';import Flux2TokenBanner from '../components/imageGen/Flux2TokenBanner';import {Image as ImageIcon, Sparkles, Download, RefreshCw, Settings as SettingsIcon,- Dice5, AlertTriangle, X, Film, Cloud, Cpu, Terminal+ Dice5, AlertTriangle, X, Film,} from 'lucide-react';+import { composeStyledPrompt } from '../lib/composeStyledPrompt';+import { deriveAvailableBackends, IMAGE_GEN_MODE } from '../lib/imageGenBackends';import toast from '../components/ui/Toast';import BrailleSpinner from '../components/BrailleSpinner';import { useImageGenProgress } from '../hooks/useImageGenProgress';@@ -94,6 +98,7 @@ export default function ImageGen() {const [prompt, setPrompt] = useState('');const [negativePrompt, setNegativePrompt] = useState(DEFAULT_NEGATIVE);+ const [stylePreset, setStylePreset] = useState(null);const [modelId, setModelId] = useState('');const [width, setWidth] = useState(1024);const [height, setHeight] = useState(1024);@@ -175,25 +180,16 @@ export default function ImageGen() {listImageGallery().then(setGallery).catch(() => {});}, []);- // Settings load — derives the chip strip and the initial selectedMode.// Re-runnable so the Settings drawer can trigger a refresh on close// without forcing a full page reload.const reloadBackends = useCallback(() => {return getSettings().then((s) => {- const ig = s?.imageGen || {};- const externalUrl = (ig.external?.sdapiUrl || ig.sdapiUrl || '').trim();- const pyPath = (ig.local?.pythonPath || '').trim();- const codexOn = ig.codex?.enabled === true;- const backends = [];- if (externalUrl) backends.push({ id: 'external', label: 'External', icon: Cloud });- if (pyPath) backends.push({ id: 'local', label: 'Local', icon: Cpu });- if (codexOn) backends.push({ id: 'codex', label: 'Codex', icon: Terminal });+ const backends = deriveAvailableBackends(s);setAvailableBackends(backends);- const saved = ig.mode || 'external';- // Prefer the saved default if viable. If the user just disabled the- // currently-selected backend, fall through to the first viable one- // (so a freshly-configured setup or a just-toggled provider Just- // Works without forcing a reload).+ const saved = s?.imageGen?.mode || IMAGE_GEN_MODE.EXTERNAL;+ // If the user just disabled the currently-selected backend, fall+ // through to the first viable one — a just-toggled provider should+ // Just Work without a page reload.setSelectedMode((prev) => {if (prev && backends.find((b) => b.id === prev)) return prev;if (backends.find((b) => b.id === saved)) return saved;@@ -398,14 +394,15 @@ export default function ImageGen() {// POST — the user keeps watching the active render and the new submission// sits in the server queue until the active one finishes.const submitGenerationPayload = async () => {+ const composed = composeStyledPrompt(prompt, negativePrompt, stylePreset);const payload = isCodexMode ? {- prompt: prompt.trim(),- negativePrompt: negativePrompt.trim() || undefined,+ prompt: composed.prompt,+ negativePrompt: composed.negativePrompt || undefined,width, height,mode: 'codex',} : {- prompt: prompt.trim(),- negativePrompt: negativePrompt.trim() || undefined,+ prompt: composed.prompt,+ negativePrompt: composed.negativePrompt || undefined,modelId: modelId || undefined,width, height,steps: steps ? Number(steps) : undefined,@@ -530,9 +527,10 @@ export default function ImageGen() {if (isAsyncMode) {await startLocalGeneration();} else {+ const composed = composeStyledPrompt(prompt, negativePrompt, stylePreset);const payload = {- prompt: prompt.trim(),- negativePrompt: negativePrompt.trim() || undefined,+ prompt: composed.prompt,+ negativePrompt: composed.negativePrompt || undefined,width, height,steps: steps ? Number(steps) : 25,cfgScale,@@ -597,6 +595,9 @@ export default function ImageGen() {};const handleRemix = (img) => {+ // Preset was already folded into the recorded prompt at submit time;+ // clear the picker so the user sees what actually produced the image.+ setStylePreset(null);if (img.prompt) setPrompt(img.prompt);if (img.negativePrompt || img.negative_prompt) setNegativePrompt(img.negativePrompt || img.negative_prompt);if (img.seed != null) setSeed(String(img.seed));@@ -649,21 +650,13 @@ export default function ImageGen() {<span className="text-gray-500">Checking…</span>)}{availableBackends.length > 1 && (- <div className="inline-flex items-center gap-1 p-0.5 border border-port-border rounded-full bg-port-bg" role="group" aria-label="Backend">- {availableBackends.map(({ id, label, icon: Icon }) => (- <button- key={id}- type="button"- onClick={() => setSelectedMode(id)}- disabled={statusLoading}- className={`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs transition-colors disabled:opacity-50 ${effectiveMode === id ? 'bg-port-accent text-white' : 'text-gray-400 hover:text-white hover:bg-port-border/40'}`}- title={`Use ${label} for the next render`}- >- <Icon className="w-3 h-3" />- {label}- </button>- ))}- </div>+ <BackendChipStrip+ availableBackends={availableBackends}+ value={effectiveMode}+ onChange={setSelectedMode}+ disabled={statusLoading}+ titlePrefix="Use"+ />)}</div><div className="flex items-center gap-1">@@ -688,6 +681,11 @@ export default function ImageGen() {<form onSubmit={handleGenerate} className="grid grid-cols-1 lg:grid-cols-[3fr_2fr] gap-4"><div className="bg-port-card border border-port-border rounded-xl p-4 space-y-3">+ <StylePresetPicker+ value={stylePreset?.id || ''}+ onChange={setStylePreset}+ disabled={statusLoading}+ /><div className="grid grid-cols-1 md:grid-cols-2 gap-3"><div><label className="block text-xs font-medium text-gray-400 mb-1">Prompt</label>diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex 71c929acc5..3c1f21f92d 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -28,7 +28,9 @@ import Drawer from '../components/Drawer';import { ImageGenTab } from '../components/settings/ImageGenTab';import MediaCard from '../components/media/MediaCard';import MediaLightbox from '../components/media/MediaLightbox';+import StylePresetPicker from '../components/media/StylePresetPicker';import { normalizeVideo } from '../components/media/normalize';+import { composeStyledPrompt } from '../lib/composeStyledPrompt';import {Film, Sparkles, Settings as SettingsIcon, RefreshCw, AlertTriangle,Dice5, X, Upload, Type, Image as ImageIcon, GitBranch, ListPlus,@@ -100,6 +102,7 @@ export default function VideoGen() {const [mode, setMode] = useState(incomingSourceImage ? 'image' : 'text');const [prompt, setPrompt] = useState(incomingPrompt || '');const [negativePrompt, setNegativePrompt] = useState(incomingNegativePrompt || '');+ const [stylePreset, setStylePreset] = useState(null);const [modelId, setModelId] = useState('');const [width, setWidth] = useState(768);const [height, setHeight] = useState(512);@@ -328,23 +331,26 @@ export default function VideoGen() {// Snapshot the current form into a generate-payload. Used both by the// inline Generate button and by enqueue, so the two paths stay in lockstep.- const buildGeneratePayload = () => ({- prompt: prompt.trim(),- negativePrompt: negativePrompt.trim() || '',- modelId,- width, height,- numFrames,- fps,- steps: steps || '',- guidanceScale: guidanceScale || '',- seed: seed || '',- tiling,- disableAudio: disableAudio ? 'true' : 'false',- mode,- sourceImageFile: (mode === 'image' || mode === 'fflf' || mode === 'extend') ? (sourceImageFile || '') : '',- sourceImage: (mode === 'image' || mode === 'fflf') ? (sourceImageUpload || '') : '',- lastImageFile: mode === 'fflf' ? (lastImageFile || '') : '',- });+ const buildGeneratePayload = () => {+ const composed = composeStyledPrompt(prompt, negativePrompt, stylePreset);+ return {+ prompt: composed.prompt,+ negativePrompt: composed.negativePrompt,+ modelId,+ width, height,+ numFrames,+ fps,+ steps: steps || '',+ guidanceScale: guidanceScale || '',+ seed: seed || '',+ tiling,+ disableAudio: disableAudio ? 'true' : 'false',+ mode,+ sourceImageFile: (mode === 'image' || mode === 'fflf' || mode === 'extend') ? (sourceImageFile || '') : '',+ sourceImage: (mode === 'image' || mode === 'fflf') ? (sourceImageUpload || '') : '',+ lastImageFile: mode === 'fflf' ? (lastImageFile || '') : '',+ };+ };// Run a single payload through the SSE pipeline. Returns a promise that// resolves when the job completes (or rejects on error / cancel). Shared@@ -627,6 +633,11 @@ export default function VideoGen() {<form onSubmit={handleGenerate} className="grid grid-cols-1 lg:grid-cols-[3fr_2fr] gap-4"><div className="bg-port-card border border-port-border rounded-xl p-4 space-y-3">+ <StylePresetPicker+ value={stylePreset?.id || ''}+ onChange={setStylePreset}+ disabled={generating}+ /><div className="grid grid-cols-1 md:grid-cols-2 gap-3"><div><label className="block text-xs font-medium text-gray-400 mb-1">Prompt</label>diff --git a/client/src/services/apiSystem.js b/client/src/services/apiSystem.jsindex 2867beb591..531852fac9 100644--- a/client/src/services/apiSystem.js+++ b/client/src/services/apiSystem.js@@ -127,6 +127,19 @@ export const generateImage = (data) => request('/image-gen/generate', {method: 'POST',body: JSON.stringify(data)});+// Curated style presets — code-static on the server, so cache the in-flight+// promise and reuse it for the lifetime of the page. Eliminates the repeat+// fetch when the user navigates ImageGen → VideoGen → Writers Room.+let stylePresetsPromise = null;+export const listImageStylePresets = () => {+ if (!stylePresetsPromise) {+ stylePresetsPromise = request('/image-gen/style-presets').catch((err) => {+ stylePresetsPromise = null;+ throw err;+ });+ }+ return stylePresetsPromise;+};export const generateAvatar = (data) => request('/image-gen/avatar', {method: 'POST',body: JSON.stringify(data)diff --git a/client/src/services/apiWritersRoom.js b/client/src/services/apiWritersRoom.jsindex 06d237dc0a..97e87e32a3 100644--- a/client/src/services/apiWritersRoom.js+++ b/client/src/services/apiWritersRoom.js@@ -2,9 +2,6 @@ import { request } from './apiCore.js';const enc = encodeURIComponent;-// Style presets — curated reference data for the world-style picker.-export const listWritersRoomStylePresets = () => request('/writers-room/style-presets');-// Foldersexport const listWritersRoomFolders = () => request('/writers-room/folders');export const createWritersRoomFolder = (data) => request('/writers-room/folders', {diff --git a/server/lib/writersRoomStylePresets.js b/server/lib/writersRoomStylePresets.jsindex 1c95b3f620..ea4fb8b98f 100644--- a/server/lib/writersRoomStylePresets.js+++ b/server/lib/writersRoomStylePresets.js@@ -1,13 +1,21 @@-// Style presets for the per-Work "world style" image-gen prompt prefix.-// These ship as code (not gitignored data) so every install gets the same-// curated starting set. Each work stores the *resolved* prompt text on its-// manifest, not the preset id alone — so editing a preset here doesn't-// silently change historical works.+// Curated style presets shared by the Writers Room storyboard and the+// standalone Image / Video gen pages. Each Work records the *resolved* prompt+// text, not just the id — editing a preset here can't retroactively change+// historical works.+//+// Fast image models (FLUX.2 Klein, Schnell) bake garbled text into images+// whenever a prompt mentions "comic", "panel", "poster", etc. — any preset+// that nudges in that direction has to suppress every form of text via the+// negative prompt explicitly.++const TEXT_NEG = 'text, words, letters, lettering, typography, title, logo, watermark, signature, caption, word balloon, speech bubble, sound effect';export const STYLE_PRESETS = [+ // ─── Cinema / Photo ────────────────────────────────────────────────{id: 'cinematic',label: 'Cinematic',+ category: 'Cinema & Photo',description: 'Film-still aesthetic. Anamorphic lenses, color grading, 35mm.',prompt: 'cinematic still, anamorphic lens, shallow depth of field, dramatic lighting, film grain, color graded, 35mm photography, atmospheric',negativePrompt: 'cartoon, anime, illustration, painting, low quality, blurry',@@ -15,20 +23,155 @@ export const STYLE_PRESETS = [{id: 'noir',label: 'Film noir',+ category: 'Cinema & Photo',description: 'High-contrast black and white, 1940s detective drama.',prompt: 'black and white film noir, high contrast chiaroscuro, deep shadows, venetian blind lighting, 1940s detective aesthetic, smoky atmosphere, cinematic composition',negativePrompt: 'color photo, modern, cartoon, anime, low contrast',},+ {+ id: 'photorealistic',+ label: 'Photorealistic',+ category: 'Cinema & Photo',+ description: 'Photographic realism, natural lighting, hyperdetailed.',+ prompt: 'photorealistic, hyperdetailed, natural lighting, professional photography, sharp focus, 8k, high dynamic range',+ negativePrompt: 'cartoon, anime, illustration, painting, sketch, 3d render',+ },+ {+ id: 'vintage-film',+ label: 'Vintage film',+ category: 'Cinema & Photo',+ description: '1970s Kodachrome, slight grain, warm fade.',+ prompt: '1970s kodachrome photograph, warm faded color palette, soft grain, slight light leaks, vintage film stock, nostalgic atmosphere, mid-century',+ negativePrompt: 'modern digital, sharp HDR, cartoon, 3d render, neon',+ },+ {+ id: 'polaroid',+ label: 'Polaroid snapshot',+ category: 'Cinema & Photo',+ description: 'Square instant photo, soft flash, candid moment.',+ prompt: 'polaroid instant photograph, square format, soft on-camera flash, slight motion blur, candid snapshot, faded edges, 1980s home photography',+ negativePrompt: 'sharp HDR, cinematic, painting, anime, 3d render',+ },+ {+ id: 'golden-hour',+ label: 'Golden hour',+ category: 'Cinema & Photo',+ description: 'Warm low sun, long shadows, lens flare.',+ prompt: 'golden hour photography, warm low-angle sunlight, long shadows, soft lens flare, glowing rim light, dust motes in the air, magic-hour palette',+ negativePrompt: 'overcast, harsh midday, cartoon, anime, 3d render',+ },+ {+ id: 'low-key',+ label: 'Low-key dramatic',+ category: 'Cinema & Photo',+ description: 'Heavy shadow, single light source, theatrical.',+ prompt: 'low-key lighting, single dramatic key light, deep black shadows, theatrical chiaroscuro, rembrandt-style portrait lighting, brooding atmosphere',+ negativePrompt: 'flat lighting, daylight, cartoon, low contrast',+ },++ // ─── Genre / Era ───────────────────────────────────────────────────{id: 'cyberpunk-neon',label: 'Cyberpunk neon',+ category: 'Genre & Era',description: 'Neon-soaked future cities, holograms, wet streets.',prompt: 'neon-soaked cyberpunk cityscape, wet rain-slick streets, holographic signage, RGB rim lighting, blade runner aesthetic, dense atmosphere, hyperdetailed',negativePrompt: 'natural daylight, rural, vintage, bright sky, cartoon',},+ {+ id: 'steampunk',+ label: 'Steampunk',+ category: 'Genre & Era',+ description: 'Brass gears, leather and copper, Victorian machinery.',+ prompt: 'steampunk aesthetic, polished brass gears and pipes, leather and copper accents, victorian machinery, gas-lamp lighting, ornate engraving, sepia palette',+ negativePrompt: 'modern, cyberpunk neon, plastic, minimalist, digital UI',+ },+ {+ id: 'dieselpunk',+ label: 'Dieselpunk',+ category: 'Genre & Era',+ description: '1940s industrial future, riveted steel, art-deco machines.',+ prompt: 'dieselpunk aesthetic, 1940s industrial-future machinery, riveted steel plating, art deco engineering, soot-stained pistons, oily metallic palette, dramatic shaft lighting',+ negativePrompt: 'sleek modern, neon, cute, pastel, cartoon',+ },+ {+ id: 'solarpunk',+ label: 'Solarpunk',+ category: 'Genre & Era',+ description: 'Lush green futurism, solar tech woven into nature.',+ prompt: 'solarpunk aesthetic, lush vertical gardens woven into curving architecture, solar panels and wind turbines integrated as design elements, soft warm sunlight, hopeful optimistic atmosphere, art-nouveau curves',+ negativePrompt: 'dystopian, dark, gritty, cyberpunk neon, ruined',+ },+ {+ id: 'dark-fantasy',+ label: 'Dark fantasy',+ category: 'Genre & Era',+ description: 'Grimdark medieval, candlelit gloom, oil-painting depth.',+ prompt: 'dark fantasy oil painting, grimdark medieval atmosphere, candlelit gloom, weathered armor and cloth, foreboding gothic architecture, frank frazetta and zdzislaw beksinski influence, painterly brushwork',+ negativePrompt: 'bright cheerful, cartoon, anime, modern, cute',+ },+ {+ id: 'high-fantasy',+ label: 'High fantasy',+ category: 'Genre & Era',+ description: 'Tolkien-esque epic, golden light, painterly grandeur.',+ prompt: 'high fantasy concept art, epic sweeping landscape, tolkien-inspired atmosphere, golden warm light, intricate elven or dwarven craft, painterly grandeur, alan lee and john howe influence',+ negativePrompt: 'photoreal, modern, cyberpunk, cartoon, low effort',+ },+ {+ id: 'space-opera',+ label: 'Space opera',+ category: 'Genre & Era',+ description: 'Star-Wars-scale sci-fi, ringed worlds, lived-in tech.',+ prompt: 'space opera concept art, vast ringed planet on the horizon, lived-in retrofuture starship interiors, dramatic sci-fi lighting, ralph mcquarrie influence, painterly cinematic',+ negativePrompt: 'modern earth, cartoon, anime, low detail, flat',+ },+ {+ id: 'cosmic-horror',+ label: 'Cosmic horror',+ category: 'Genre & Era',+ description: 'Lovecraftian dread, sickly palette, impossible geometry.',+ prompt: 'cosmic horror illustration, lovecraftian atmosphere, sickly green and bruised purple palette, non-euclidean impossible geometry, oppressive scale, ink and watercolor wash',+ negativePrompt: 'cute, bright, cheerful, cartoon, anime, modern',+ },+ {+ id: 'vaporwave',+ label: 'Vaporwave',+ category: 'Genre & Era',+ description: '80s/90s nostalgia, pink/teal grids, glitch.',+ prompt: 'vaporwave aesthetic, 1980s sunset gradient, pink and teal color palette, neon grid floor, retro CGI marble busts, VHS scanlines and glitch artifacts, nostalgic',+ negativePrompt: 'photoreal, modern, gritty, dark, oil painting',+ },+ {+ id: '80s-scifi',+ label: '80s sci-fi paperback',+ category: 'Genre & Era',+ description: 'Airbrushed paperback cover, chrome and starfields.',+ prompt: '1980s science fiction paperback cover painting, airbrushed chrome and matte starfields, bold gradients, michael whelan and chris foss influence, clean composition',+ negativePrompt: 'photoreal, modern, gritty, lo-fi, cartoon',+ },+ {+ id: 'victorian',+ label: 'Victorian',+ category: 'Genre & Era',+ description: '19th-century engraving, gas lamps, ornate detail.',+ prompt: 'victorian era illustration, 19th century steel-engraving aesthetic, gas-lamp lighting, ornate ironwork and damask, sepia and bottle-green palette, period-accurate clothing',+ negativePrompt: 'modern, futuristic, cartoon, anime, neon',+ },+ {+ id: 'wes-anderson',+ label: 'Wes Anderson',+ category: 'Genre & Era',+ description: 'Pastel symmetry, dollhouse staging, deadpan whimsy.',+ prompt: 'wes anderson cinematography, perfectly centered symmetric composition, pastel color palette, dollhouse-flat staging, retro vintage props, soft daylight, deadpan whimsical atmosphere',+ negativePrompt: 'gritty, asymmetric, dark, photoreal HDR, cartoon',+ },++ // ─── Animation ─────────────────────────────────────────────────────{id: 'ghibli',label: 'Studio Ghibli',+ category: 'Animation',description: 'Hand-painted watercolor backgrounds, expressive characters.',prompt: 'studio ghibli animation, hand-painted watercolor backgrounds, soft pastel palette, expressive characters, miyazaki style, whimsical, gentle lighting',negativePrompt: 'photorealistic, photograph, 3d render, realistic, harsh shadows, gritty',@@ -36,43 +179,169 @@ export const STYLE_PRESETS = [{id: 'pixar',label: 'Pixar 3D',+ category: 'Animation',description: 'Vibrant 3D animated movie style with soft lighting.',prompt: 'pixar 3d animation style, expressive cartoon characters, vibrant saturated colors, soft volumetric lighting, polished render, cinematic depth of field',negativePrompt: 'photorealistic, photograph, anime, hand-drawn, sketch',},+ {+ id: 'disney-2d',+ label: 'Disney 2D classic',+ category: 'Animation',+ description: 'Hand-drawn cel animation, sweeping linework.',+ prompt: 'classic disney 2d animation, hand-drawn cel animation, sweeping confident linework, lush painted backgrounds, expressive character acting, golden-age technicolor palette',+ negativePrompt: 'photoreal, 3d render, gritty, anime, low effort',+ },+ {+ id: 'anime-modern',+ label: 'Anime (modern)',+ category: 'Animation',+ description: 'Crisp digital anime, vibrant cel shading, expressive.',+ prompt: 'modern anime illustration, crisp clean linework, vibrant cel shading, expressive eyes, dynamic composition, kyoto animation / makoto shinkai influence, detailed backgrounds',+ negativePrompt: 'photoreal, western cartoon, oil painting, 3d render, blurry',+ },+ {+ id: 'anime-90s',+ label: '90s anime',+ category: 'Animation',+ description: 'VHS-era cel animation, muted palette, grainy.',+ prompt: '1990s anime cel animation, hand-painted backgrounds, muted earthy palette, slight VHS grain, hard shading, akira / ghost in the shell aesthetic, cinematic framing',+ negativePrompt: 'modern digital, sharp HDR, photoreal, 3d render',+ },+ {+ id: 'claymation',+ label: 'Claymation',+ category: 'Animation',+ description: 'Stop-motion clay, fingerprint texture, soft studio light.',+ prompt: 'claymation stop-motion, hand-sculpted clay characters with visible fingerprint texture, miniature handcrafted set, soft studio lighting, aardman / laika aesthetic, tactile materiality',+ negativePrompt: 'photoreal humans, 3d render polish, cartoon flat, anime',+ },++ // ─── Illustration / Comics ─────────────────────────────────────────{id: 'graphic-novel',label: 'Graphic novel',+ category: 'Illustration & Comics',description: 'Bold ink linework, halftone shading, limited palette.',- // Fast image models (FLUX.2 Klein, Schnell) render text as garbled- // gibberish. "sequential art panels" reliably summons word balloons and- // sound effects, so it's pulled out of the prompt and the negative- // prompt explicitly suppresses every form of text the model might add.+ // "sequential art panels" reliably summons word balloons and sound+ // effects, so it's pulled out of the prompt and the negative prompt+ // explicitly suppresses every form of text the model might add.prompt: 'graphic novel illustration, bold ink outlines, halftone shading, limited muted color palette, mike mignola influence, cinematic framing, single full-bleed image, no text',- negativePrompt: 'photorealistic, photograph, 3d render, soft watercolor, anime, text, words, letters, lettering, typography, title, logo, word balloon, speech bubble, caption box, sound effect, comic book cover',+ negativePrompt: `photorealistic, photograph, 3d render, soft watercolor, anime, ${TEXT_NEG}, comic book cover`,+ },+ {+ id: 'comic-book',+ label: 'Comic book',+ category: 'Illustration & Comics',+ description: 'American comic book art, ink and color, dynamic angles.',+ // Same text-suppression as graphic novel — fast models bake garbled+ // word balloons and "POW" sound effects into the image otherwise.+ prompt: 'american comic book art, dynamic poses, bold ink and flat color, ben-day dots, dramatic angles, action-oriented composition, jim lee influence, single full-bleed image, no text',+ negativePrompt: `photorealistic, photograph, soft watercolor, anime, low contrast, ${TEXT_NEG}, onomatopoeia, comic book cover`,+ },+ {+ id: 'manga-bw',+ label: 'Manga (B&W)',+ category: 'Illustration & Comics',+ description: 'Black-and-white manga, screentone, dynamic linework.',+ prompt: 'black and white manga illustration, fine ink linework, screentone shading, dramatic speed lines, dynamic composition, single full-bleed image, no text',+ negativePrompt: `color, photoreal, 3d render, oil painting, ${TEXT_NEG}`,},{id: 'watercolor-storybook',label: 'Watercolor storybook',+ category: 'Illustration & Comics',description: "Children's-book illustration, soft edges, warm palette.",prompt: "watercolor children's storybook illustration, soft watercolor edges, warm pastel palette, hand-drawn ink lines, cozy and whimsical, gentle composition",negativePrompt: 'photorealistic, photograph, dark, gritty, cyberpunk, harsh',},{- id: 'comic-book',- label: 'Comic book',- description: 'American comic book art, ink and color, dynamic angles.',- // Same text-suppression as graphic novel — fast models bake garbled- // word balloons and "POW" sound effects into the image otherwise.- prompt: 'american comic book art, dynamic poses, bold ink and flat color, ben-day dots, dramatic angles, action-oriented composition, jim lee influence, single full-bleed image, no text',- negativePrompt: 'photorealistic, photograph, soft watercolor, anime, low contrast, text, words, letters, lettering, typography, title, logo, word balloon, speech bubble, caption box, sound effect, onomatopoeia, comic book cover',+ id: 'oil-painting',+ label: 'Oil painting',+ category: 'Illustration & Comics',+ description: 'Classical oil on canvas, visible brushwork, rich glaze.',+ prompt: 'classical oil painting, visible impasto brushwork, rich pigment glazes, chiaroscuro lighting, museum-quality canvas texture, painterly atmosphere',+ negativePrompt: 'photoreal, digital art, 3d render, cartoon, sharp HDR',},{- id: 'photorealistic',- label: 'Photorealistic',- description: 'Photographic realism, natural lighting, hyperdetailed.',- prompt: 'photorealistic, hyperdetailed, natural lighting, professional photography, sharp focus, 8k, high dynamic range',- negativePrompt: 'cartoon, anime, illustration, painting, sketch, 3d render',+ id: 'impressionist',+ label: 'Impressionist',+ category: 'Illustration & Comics',+ description: 'Loose brush, dappled light, Monet/Renoir era.',+ prompt: 'impressionist oil painting, loose visible brushstrokes, dappled natural light, broken color, monet and renoir era atmosphere, dreamy outdoor scene',+ negativePrompt: 'sharp lines, photoreal, 3d render, cartoon, hard edges',+ },+ {+ id: 'art-deco',+ label: 'Art Deco',+ category: 'Illustration & Comics',+ description: '1920s geometric glamour, gold and lacquer, fan motifs.',+ prompt: 'art deco illustration, 1920s geometric glamour, gold and black lacquer palette, sunburst and fan motifs, stylized streamlined figures, erté influence, ornamental symmetry',+ negativePrompt: 'photoreal, gritty, modern, anime, low effort',+ },+ {+ id: 'art-nouveau',+ label: 'Art Nouveau',+ category: 'Illustration & Comics',+ description: 'Mucha-style flowing florals, decorative borders.',+ prompt: 'art nouveau illustration, alphonse mucha style, flowing organic floral borders, decorative arch framing, soft pastel palette with gold accents, idealized figure, ornamental linework',+ negativePrompt: 'photoreal, modern, gritty, 3d render, dark',+ },+ {+ id: 'ukiyo-e',+ label: 'Ukiyo-e woodblock',+ category: 'Illustration & Comics',+ description: 'Edo-era Japanese woodblock, flat color, clean outlines.',+ prompt: 'ukiyo-e japanese woodblock print, edo period aesthetic, flat blocks of muted color, clean black outlines, stylized waves and mountains, hokusai and hiroshige influence',+ negativePrompt: 'photoreal, 3d render, oil painting, modern, gritty',+ },+ {+ id: 'concept-art',+ label: 'Concept art',+ category: 'Illustration & Comics',+ description: 'Production-quality concept painting, painterly + crisp.',+ prompt: 'professional concept art painting, cinematic composition, painterly rendering with crisp focal detail, atmospheric perspective, production-quality, craig mullins / feng zhu influence',+ negativePrompt: 'cartoon, low effort, sketch, anime, photoreal',+ },+ {+ id: 'pixel-art',+ label: 'Pixel art',+ category: 'Illustration & Comics',+ description: '16-bit-era sprites, limited palette, crisp pixels.',+ prompt: '16-bit pixel art, limited retro game palette, crisp aliased pixels, hand-placed dithering, side-scroller sprite aesthetic, snes / sega genesis era',+ negativePrompt: 'smooth, blurry, photoreal, 3d render, anti-aliased',+ },+ {+ id: 'low-poly',+ label: 'Low-poly 3D',+ category: 'Illustration & Comics',+ description: 'Faceted geometry, flat shading, minimal palette.',+ prompt: 'low-poly 3d render, faceted geometry, flat-shaded triangular surfaces, minimal pastel palette, isometric composition, indie game aesthetic',+ negativePrompt: 'photoreal, smooth subdivision, painterly, anime, gritty',+ },+ {+ id: 'isometric',+ label: 'Isometric',+ category: 'Illustration & Comics',+ description: 'Tilted top-down, miniature diorama, clean shapes.',+ prompt: 'isometric illustration, 30-degree tilted top-down perspective, clean geometric shapes, miniature diorama composition, soft pastel palette, modern editorial illustration',+ negativePrompt: 'photoreal, dramatic perspective, gritty, anime',+ },+ {+ id: 'blueprint',+ label: 'Technical blueprint',+ category: 'Illustration & Comics',+ description: 'White-on-blue line drawing, callouts, schematic.',+ prompt: 'technical blueprint illustration, crisp white linework on deep blue background, schematic cross-section, dimension callouts, drafting aesthetic, no text',+ negativePrompt: `photoreal, painterly, anime, 3d render, ${TEXT_NEG}`,+ },+ {+ id: 'ink-wash',+ label: 'Ink wash (sumi-e)',+ category: 'Illustration & Comics',+ description: 'Brush-and-ink, negative space, gestural strokes.',+ prompt: 'sumi-e ink wash painting, gestural brush strokes on rice paper, dramatic negative space, monochromatic black ink with single accent color, zen minimalism',+ negativePrompt: 'photoreal, color saturation, 3d render, cartoon, busy',},];diff --git a/server/routes/imageGen.js b/server/routes/imageGen.jsindex 5487804204..4bc430b219 100644--- a/server/routes/imageGen.js+++ b/server/routes/imageGen.js@@ -30,9 +30,12 @@ import {} from '../lib/pythonSetup.js';import { PATHS, ensureDir } from '../lib/fileUtils.js';import { join, basename, resolve as resolvePath, sep as PATH_SEP } from 'node:path';+import { STYLE_PRESETS } from '../lib/writersRoomStylePresets.js';const router = Router();+router.get('/style-presets', (_req, res) => res.json(STYLE_PRESETS));+const generateSchema = z.object({prompt: z.string().min(1).max(2000),negativePrompt: z.string().max(2000).optional(),diff --git a/server/routes/writersRoom.js b/server/routes/writersRoom.jsindex c0faaa0791..ea73c59b4d 100644--- a/server/routes/writersRoom.js+++ b/server/routes/writersRoom.js@@ -37,14 +37,9 @@ import {listSettings, createSetting, updateSetting, deleteSetting,} from '../services/writersRoom/settings.js';import { addItem as addCollectionItem, ERR_DUPLICATE } from '../services/mediaCollections.js';-import { STYLE_PRESETS } from '../lib/writersRoomStylePresets.js';const router = Router();-// Curated world-style presets for image gen — code-shipped reference data,-// not user-mutable, so a simple GET is enough.-router.get('/style-presets', (_req, res) => res.json(STYLE_PRESETS));-// ---------- folders ----------router.get('/folders', asyncHandler(async (_req, res) => {diff --git a/server/services/imageGen/codex.js b/server/services/imageGen/codex.jsindex 75279732b4..4d74994f8e 100644--- a/server/services/imageGen/codex.js+++ b/server/services/imageGen/codex.js@@ -137,6 +137,9 @@ export async function generateImage({ codexPath, model, prompt, width, height, nreturn {jobId, filename, path: `/data/images/${filename}`, generationId: jobId,mode: 'codex', model: model || null,+ // Async callers gate UI state on `status`; without 'running' they flip+ // to 'done' before the PNG lands. SSE / socket 'completed' fires later.+ status: 'running',};}