The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Assist: the Demo badge sits in a text card's header row, so it never covers the TEXT label
Claude0b6769e9b9a5
diff --git a/src/components/assist/project-view.tsx b/src/components/assist/project-view.tsxindex 86fab781..f6d06806 100644--- a/src/components/assist/project-view.tsx+++ b/src/components/assist/project-view.tsx@@ -240,8 +240,8 @@ function Assets({ p, active }: { p: AssistProject; active: boolean }) {{tiles.map(({ a, at, o, i }) => (<li key={`${a.generation.id}-${i}`}><button onClick={() => setOpen({ at, i })} className="group relative block aspect-square w-full overflow-hidden rounded-xl bg-muted" aria-label={`Open ${a.generation.request.prompt?.slice(0, 60) || "result"} (from ${a.chatTitle})`}>- <MediaThumb output={o} g={a.generation} className="transition duration-300 group-hover:scale-[1.03]" />- {a.generation.provider === "mock" && <span className="absolute top-1.5 right-1.5 rounded-full bg-background/80 px-1.5 py-0.5 text-[10px] font-medium">Demo</span>}+ <MediaThumb output={o} g={a.generation} className="transition duration-300 group-hover:scale-[1.03]" tag={a.generation.provider === "mock" && o.kind === "text" ? "Demo" : undefined} />+ {a.generation.provider === "mock" && o.kind !== "text" && <span className="absolute top-1.5 right-1.5 rounded-full bg-background/80 px-1.5 py-0.5 text-[10px] font-medium">Demo</span>}</button></li>))}diff --git a/src/components/assist/transcript.tsx b/src/components/assist/transcript.tsxindex d4b24bb7..387aba8f 100644--- a/src/components/assist/transcript.tsx+++ b/src/components/assist/transcript.tsx@@ -156,8 +156,9 @@ export function GenerationCards({ ids, all, storyboard, onOpen }: { ids: string[if (g.status === "succeeded") {return g.outputs.map((o, i) => (<button key={`${g.id}-${i}`} onClick={() => onOpen(g, i)} className="group relative overflow-hidden rounded-xl bg-muted" style={{ aspectRatio: ratio }} aria-label={`Open ${g.request.prompt?.slice(0, 60) || "result"}`}>- <MediaThumb output={o} className="transition duration-300 group-hover:scale-[1.02]" />- {g.provider === "mock" && <span className="absolute top-2 right-2 rounded-full bg-background/80 px-2 py-0.5 text-[10px] font-medium">Demo</span>}+ {/* A text card says "Demo" in its own header row: on a narrow tile a corner badge would cover its label. */}+ <MediaThumb output={o} className="transition duration-300 group-hover:scale-[1.02]" tag={g.provider === "mock" && o.kind === "text" ? "Demo" : undefined} />+ {g.provider === "mock" && o.kind !== "text" && <span className="absolute top-2 right-2 rounded-full bg-background/80 px-2 py-0.5 text-[10px] font-medium">Demo</span>}</button>));}diff --git a/src/components/studio/result-media.tsx b/src/components/studio/result-media.tsxindex c1e203f9..6dc43a67 100644--- a/src/components/studio/result-media.tsx+++ b/src/components/studio/result-media.tsx@@ -13,6 +13,7 @@ export function MediaThumb({className,autoPlay,fit,+ tag,}: {output: OutputFile;/** The generation it belongs to (3D models show a sibling turntable or poster). */@@ -21,6 +22,8 @@ export function MediaThumb({autoPlay?: boolean;/** Letterbox instead of crop (Library "Fit"). */fit?: boolean;+ /** A small badge ("Demo") a text card shows in its own header row, where it can't cover the label. */+ tag?: string;}) {const object = fit ? "object-contain" : "object-cover";if (output.kind === "video") {@@ -48,7 +51,7 @@ export function MediaThumb({</div>);}- if (output.kind === "text") return <TextPreview output={output} className={className} />;+ if (output.kind === "text") return <TextPreview output={output} className={className} tag={tag} />;if (output.kind === "model3d") {const { poster, video } = modelPreview(g ?? { outputs: [output] }, output);if (video) return <MediaThumb output={{ url: video, kind: "video" }} autoPlay={autoPlay} fit={fit} className={className} />;@@ -85,13 +88,16 @@ export function SmallThumb({ g, output }: { g: Generation; output: OutputFile })}/** A transcript, translation or script as a readable card: the first lines and a cue count. */-export function TextPreview({ output, className }: { output: OutputFile; className?: string }) {+export function TextPreview({ output, className, tag }: { output: OutputFile; className?: string; tag?: string }) {const cues = cuesOf(output);const text = textOf(output).trim();return (- <div className={cn("flex size-full flex-col gap-2 bg-card p-4 text-left", className)}>- <span className="inline-flex items-center gap-1.5 text-[11px] font-medium tracking-wide text-muted-foreground uppercase">- <FileText className="size-3.5" /> {cues.length ? `Transcript · ${cues.length} lines` : "Text"}+ // A size container: on a narrow tile (a phone's three-column grid) the header drops its icon to keep the label readable.+ <div className={cn("@container flex size-full flex-col gap-2 bg-card p-4 text-left", className)}>+ <span className="flex min-w-0 items-center gap-1.5 text-[11px] font-medium tracking-wide text-muted-foreground uppercase">+ <FileText className="size-3.5 shrink-0 @max-[8rem]:hidden" />+ <span className="min-w-0 flex-1 truncate">{cues.length ? `Transcript · ${cues.length} lines` : "Text"}</span>+ {tag && <span className="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] tracking-normal text-foreground normal-case">{tag}</span>}</span><p className="line-clamp-[8] min-h-0 flex-1 overflow-hidden text-[13px] leading-relaxed break-words whitespace-pre-line text-foreground">{text || "Empty"}</p></div>