Skip to content

armgit / fuobe

Public Imported from GitHub
0

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.

Apps: Tap to Recolor gets a cover, an example photo and a wider edge on draped necklines

Adarshe4ea0e143c61
diff --git a/public/previews/presets/app-tap-to-recolor.jpg b/public/previews/presets/app-tap-to-recolor.jpg
new file mode 100644
index 00000000..dd5f296d
Binary files /dev/null and b/public/previews/presets/app-tap-to-recolor.jpg differ
diff --git a/public/previews/presets/app-tap-to-recolor.mp4 b/public/previews/presets/app-tap-to-recolor.mp4
new file mode 100644
index 00000000..6be9b609
Binary files /dev/null and b/public/previews/presets/app-tap-to-recolor.mp4 differ
diff --git a/public/previews/presets/thumbs/app-tap-to-recolor.jpg b/public/previews/presets/thumbs/app-tap-to-recolor.jpg
new file mode 100644
index 00000000..41832012
Binary files /dev/null and b/public/previews/presets/thumbs/app-tap-to-recolor.jpg differ
diff --git a/public/samples/recolor-example.jpg b/public/samples/recolor-example.jpg
new file mode 100644
index 00000000..8a7ebed8
Binary files /dev/null and b/public/samples/recolor-example.jpg differ
diff --git a/scripts/comfy/hand-built/qwen-image-21-recolor.json b/scripts/comfy/hand-built/qwen-image-21-recolor.json
index acbddf82..ea47b442 100644
--- a/scripts/comfy/hand-built/qwen-image-21-recolor.json
+++ b/scripts/comfy/hand-built/qwen-image-21-recolor.json
@@ -125,7 +125,7 @@
},
"21": {
"inputs": {
- "expand": 8,
+ "expand": 16,
"tapered_corners": true,
"mask": [
"20",
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjs
index da7e25d8..e331057d 100644
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@ -3162,8 +3162,8 @@ export const SPEC = [
'each tap asks for the smallest thing of the piece\'s name under it (Jacket: jacket + clothing; Auto: clothing, bag, shoe, hat, scarf), a Leave out tap takes away a hand, arm, hair, ' +
'belt, bag strap or necklace under it. SAM 3.1\'s point prompt alone (SAM3_Detect) returned the whole person on every GPU test, so taps go through names. If nothing is found ' +
'the mask is empty and the photo comes back unchanged (if_nothing "empty mask"); free_vram unloads SAM before the repaint. -> GrowMask maskGrow (1) -> Crop For Inpaint ' +
- '(context 1.4, blend 2 px, multiple 32, 1.5 MP, bicubic: a tight paste, since a wider one showed a blotchy rim on flat studio backgrounds) -> GrowMask 8 on the crop\'s mask ' +
- '(the sampling mask: smaller left old-colour specks at the edge) -> StringFormat "{a} Keep everything else in the picture exactly the same." -> TextEncodeQwenImage21 with ' +
+ '(context 1.4, blend 2 px, multiple 32, 1.5 MP, bicubic: a tight paste, since a wider one showed a blotchy rim on flat studio backgrounds) -> GrowMask 16 on the crop\'s mask ' +
+ '(the sampling mask: 8 left a thin line of the old colour along a draped neckline, smaller left old-colour specks at the edge) -> StringFormat "{a} Keep everything else in the picture exactly the same." -> TextEncodeQwenImage21 with ' +
'the crop as image 1 (resolution 0) -> VAEEncode + SetLatentNoiseMask -> QwenImage21Cache -> KSampler 20 steps, cfg 1, euler, simple (16 looked the same as 25 on the tests) -> ' +
'SplitImageWithAlpha -> Stitch Inpaint (classic, colour match 0: a tone match would pull the new colour back). Outside the piece the photo is bit-identical. ' +
'RTX 5090: about 32 s per colour warm at 1.5 MP (target_megapixels 1.0 + 16 steps: 19 s, slightly softer stripes), peak 23 GB. ' +
diff --git a/src/components/recolor/recolor-tool.tsx b/src/components/recolor/recolor-tool.tsx
index 2a80c857..19484378 100644
--- a/src/components/recolor/recolor-tool.tsx
+++ b/src/components/recolor/recolor-tool.tsx
@@ -10,14 +10,17 @@ import { Segmented } from "@/components/faceless/controls";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { FrameStage, type Frame } from "@/components/remove-object/frame-stage";
import { fileToSlot, kindOfFile, LibraryGrid, type SlotValue } from "@/components/studio/media-slot";
-import { useAskBeforeUpload, useCreateGeneration, useGenerations } from "@/lib/api";
+import { askToSignUp, useAskBeforeUpload, useCreateGeneration, useGenerations, useIsGuest } from "@/lib/api";
import { colourChip, ITEMS, normaliseHex, RECOLOR, recolorRequest, SWATCHES } from "@/lib/catalog/recolor";
import type { PixelPoint } from "@/lib/catalog/types";
import { toastError } from "@/lib/refusals";
+import { postFile } from "@/lib/upload";
import { cn } from "@/lib/utils";
import { RecolorResult } from "./recolor-result";
const SUBTITLE = "Tap the dress, the jacket or the bag, then pick a colour. Folds, texture and shine stay exactly as they are, and nothing else in the photo changes.";
+/** A photo anyone can tap before adding their own (a run sends it as the visitor's own upload). */
+const EXAMPLE = "/samples/recolor-example.jpg";
const TAP_WORDS = { positive: "recolour", negative: "leave out", ask: "Tap what to recolour", frame: "Your photo" };
/** The picture's own size, read by the browser once it loads (the taps are in its pixels). */
@@ -102,6 +105,18 @@ function AddPhoto({ onPick }: { onPick: (v: SlotValue | null) => void }) {
</PopoverContent>
</Popover>
</div>
+ <button
+ type="button"
+ onClick={() => onPick({ ref: "", preview: EXAMPLE, kind: "image", name: "recolor-example.jpg" })}
+ className="mt-1 flex items-center gap-3 rounded-xl border bg-card p-1.5 pr-4 text-left outline-none transition hover:border-border-strong focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img src={EXAMPLE} alt="" width={64} height={48} className="h-12 w-16 rounded-lg object-cover" />
+ <span>
+ <span className="block text-[13px] font-medium">Try it on this photo</span>
+ <span className="block text-[12px] text-muted-foreground">Tap the dress, then pick a colour</span>
+ </span>
+ </button>
<input
id={inputId}
type="file"
@@ -213,6 +228,8 @@ export function RecolorTool({ app }: { app: { name: string; description: string
const [custom, setCustom] = useState("#C98B93");
const [sending, setSending] = useState(false);
const create = useCreateGeneration();
+ const askFirst = useAskBeforeUpload();
+ const guest = useIsGuest();
const frame = useFrame(photo?.preview);
const current = useRef<SlotValue | null>(null);
@@ -225,15 +242,28 @@ export function RecolorTool({ app }: { app: { name: string; description: string
}, []);
useHandoff(take);
- const ready = photo && !photo.uploading && photo.ref ? photo : null;
+ const example = photo?.preview === EXAMPLE && !photo.ref;
+ const ready = photo && !photo.uploading && (photo.ref || example) ? photo : null;
const taps = points.filter((p) => p.label !== "negative").length;
const blocker = !ready ? "Add a photo" : !taps ? "Tap the piece you want in a new colour." : !colours.length ? "Pick a colour" : null;
const go = async () => {
if (blocker || !ready || !frame) return void toast(blocker ?? "Add a photo");
+ // The example photo goes up as the visitor's own picture the first time it runs. A guest is asked to sign up for
+ // the run itself (they added no file of their own); an account that can't add pictures gets the usual card.
+ if (example && guest) return askToSignUp("run");
+ if (example && askFirst()) return;
setSending(true);
try {
- for (const colour of colours) await create.mutateAsync(recolorRequest({ image: ready.ref, points, frame, colour, item }));
+ let image = ready.ref;
+ if (!image) {
+ const blob = await (await fetch(EXAMPLE)).blob();
+ image = (await postFile(new File([blob], "recolor-example.jpg", { type: blob.type || "image/jpeg" }))).url;
+ const sent: SlotValue = { ref: image, preview: EXAMPLE, kind: "image", name: "recolor-example.jpg" };
+ current.current = sent;
+ setPhoto(sent);
+ }
+ for (const colour of colours) await create.mutateAsync(recolorRequest({ image, points, frame, colour, item }));
toast.success(colours.length > 1 ? `Recolouring in ${colours.length} colours` : "Recolouring");
document.getElementById("recolor-results")?.scrollIntoView({ behavior: "smooth", block: "start" });
} catch (e) {
diff --git a/src/lib/preset-covers.generated.ts b/src/lib/preset-covers.generated.ts
index 72ba746f..71fe844e 100644
--- a/src/lib/preset-covers.generated.ts
+++ b/src/lib/preset-covers.generated.ts
@@ -119,6 +119,7 @@ export const PRESET_COVERS: Record<string, PresetCoverEntry> = {
"app-style-snap": ["bae8cec2","5dbb6995"],
"app-style-transfer": ["3cf4b327","77efd8f7"],
"app-talking-photo": ["923f7be1","564d2d8b"],
+ "app-tap-to-recolor": ["f3345bc5","dbcc3189"],
"app-text-edit": ["4805cf16","7d6b1f6d"],
"app-this-is-fine": "feb86e48",
"app-transitions": "7a7e55bb",
diff --git a/src/lib/preset-featured.ts b/src/lib/preset-featured.ts
index be3267a2..2e35e6b3 100644
--- a/src/lib/preset-featured.ts
+++ b/src/lib/preset-featured.ts
@@ -11,7 +11,7 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {
`
app-behind-the-scenes app-relight app-macroshot-product app-sketch-to-real app-age-shift app-makeup-studio
app-angles app-shots app-match-lighting app-match-colors app-product-shot app-bullet-time-scene
- app-bullet-time-splash app-chameleon app-outfit-swap app-steal-the-look app-outfit-shot app-color-grading
+ app-bullet-time-splash app-chameleon app-outfit-swap app-tap-to-recolor app-steal-the-look app-outfit-shot app-color-grading
app-video-face-swap app-video-background-remover app-clean-up-voice app-breakdown
`,
`
@@ -34,7 +34,7 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {
app-3d-figure app-idol app-60s-cafe app-hook-frame app-kick-ad app-graffiti-ad app-volcano-ad app-simlife
app-pixel-game app-brick-cube app-micro-beasts app-paint-app app-social-media-icon app-victory-card app-comic-book
app-glitter-sticker app-mukbang app-roller-coaster app-banana-eating app-sticker-pack app-plushies
- app-meme-generator app-cloud-surf app-game-dump app-japanese-show app-skibidi app-tap-to-recolor
+ app-meme-generator app-cloud-surf app-game-dump app-japanese-show app-skibidi
`,
],
motion: [
diff --git a/src/lib/preset-previews.generated.ts b/src/lib/preset-previews.generated.ts
index 2da53035..7e516ade 100644
--- a/src/lib/preset-previews.generated.ts
+++ b/src/lib/preset-previews.generated.ts
@@ -877,6 +877,14 @@ export const PRESET_PREVIEWS: Record<string, PresetPreviewMedia> = {
"model": "minimax-h3",
"variant": "lean-json"
},
+ "app-tap-to-recolor": {
+ "poster": "/previews/presets/app-tap-to-recolor.jpg?v=f3345bc5",
+ "video": "/previews/presets/app-tap-to-recolor.mp4?v=dbcc3189",
+ "run": "comfyui-previews-2026-10",
+ "engine": "comfyui",
+ "model": "ideogram4+qwen-image-2.1-edit",
+ "variant": "lean-json"
+ },
"app-text-edit": {
"poster": "/previews/presets/app-text-edit.jpg?v=4805cf16",
"video": "/previews/presets/app-text-edit.mp4?v=7d6b1f6d",
diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.json
index 7613d582..637d45f7 100644
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@ -12588,7 +12588,7 @@
"vramGb": 20,
"license": "Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Meta SAM License (SAM 3.1); AusBoss nodes MIT",
"validated": true,
- "notes": "Tap to Recolor: qwen-image-21-inpaint with the mask made in the graph from the taps by AusBoss Mask by Touch on core SAM 3.1. touches = the node's JSON {\"v\":1,\"items\":[{\"t\":\"name\",\"w\":word,\"x\":int,\"y\":int,\"op\":1|0}]} in the photo's pixels (src/lib/catalog/recolor.ts recolorTouches): each tap asks for the smallest thing of the piece's name under it (Jacket: jacket + clothing; Auto: clothing, bag, shoe, hat, scarf), a Leave out tap takes away a hand, arm, hair, belt, bag strap or necklace under it. SAM 3.1's point prompt alone (SAM3_Detect) returned the whole person on every GPU test, so taps go through names. If nothing is found the mask is empty and the photo comes back unchanged (if_nothing \"empty mask\"); free_vram unloads SAM before the repaint. -> GrowMask maskGrow (1) -> Crop For Inpaint (context 1.4, blend 2 px, multiple 32, 1.5 MP, bicubic: a tight paste, since a wider one showed a blotchy rim on flat studio backgrounds) -> GrowMask 8 on the crop's mask (the sampling mask: smaller left old-colour specks at the edge) -> StringFormat \"{a} Keep everything else in the picture exactly the same.\" -> TextEncodeQwenImage21 with the crop as image 1 (resolution 0) -> VAEEncode + SetLatentNoiseMask -> QwenImage21Cache -> KSampler 20 steps, cfg 1, euler, simple (16 looked the same as 25 on the tests) -> SplitImageWithAlpha -> Stitch Inpaint (classic, colour match 0: a tone match would pull the new colour back). Outside the piece the photo is bit-identical. RTX 5090: about 32 s per colour warm at 1.5 MP (target_megapixels 1.0 + 16 steps: 19 s, slightly softer stripes), peak 23 GB. Prompt: \"Change the colour of <the piece> (Auto: the outfit) to <colour words (#hex)>. Keep its fabric, weave, folds, seams, stitching, sheen, print and shadows exactly as they are, so only the colour is new.\""
+ "notes": "Tap to Recolor: qwen-image-21-inpaint with the mask made in the graph from the taps by AusBoss Mask by Touch on core SAM 3.1. touches = the node's JSON {\"v\":1,\"items\":[{\"t\":\"name\",\"w\":word,\"x\":int,\"y\":int,\"op\":1|0}]} in the photo's pixels (src/lib/catalog/recolor.ts recolorTouches): each tap asks for the smallest thing of the piece's name under it (Jacket: jacket + clothing; Auto: clothing, bag, shoe, hat, scarf), a Leave out tap takes away a hand, arm, hair, belt, bag strap or necklace under it. SAM 3.1's point prompt alone (SAM3_Detect) returned the whole person on every GPU test, so taps go through names. If nothing is found the mask is empty and the photo comes back unchanged (if_nothing \"empty mask\"); free_vram unloads SAM before the repaint. -> GrowMask maskGrow (1) -> Crop For Inpaint (context 1.4, blend 2 px, multiple 32, 1.5 MP, bicubic: a tight paste, since a wider one showed a blotchy rim on flat studio backgrounds) -> GrowMask 16 on the crop's mask (the sampling mask: 8 left a thin line of the old colour along a draped neckline, smaller left old-colour specks at the edge) -> StringFormat \"{a} Keep everything else in the picture exactly the same.\" -> TextEncodeQwenImage21 with the crop as image 1 (resolution 0) -> VAEEncode + SetLatentNoiseMask -> QwenImage21Cache -> KSampler 20 steps, cfg 1, euler, simple (16 looked the same as 25 on the tests) -> SplitImageWithAlpha -> Stitch Inpaint (classic, colour match 0: a tone match would pull the new colour back). Outside the piece the photo is bit-identical. RTX 5090: about 32 s per colour warm at 1.5 MP (target_megapixels 1.0 + 16 steps: 19 s, slightly softer stripes), peak 23 GB. Prompt: \"Change the colour of <the piece> (Auto: the outfit) to <colour words (#hex)>. Keep its fabric, weave, folds, seams, stitching, sheen, print and shadows exactly as they are, so only the colour is new.\""
},
{
"id": "qwen-image-21-outpaint",
diff --git a/workflows/comfyui/qwen-image-21-recolor.json b/workflows/comfyui/qwen-image-21-recolor.json
index acbddf82..ea47b442 100644
--- a/workflows/comfyui/qwen-image-21-recolor.json
+++ b/workflows/comfyui/qwen-image-21-recolor.json
@@ -125,7 +125,7 @@
},
"21": {
"inputs": {
- "expand": 8,
+ "expand": 16,
"tapered_corners": true,
"mask": [
"20",