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
Watermark Remover: find the marks on a photo, keep any, remove the rest
Adarshe3fefbb79341
diff --git a/CREDITS.md b/CREDITS.mdindex aa172048..0822b175 100644--- a/CREDITS.md+++ b/CREDITS.md@@ -28,7 +28,7 @@ Some licences ask the app that runs their model to say so.## Open model licences-195 models, one row for each set of open weights Fuobe runs: 94 allow commercial use, 37 with conditions, 43 are non-commercial and 22 aren't available everywhere.+201 models, one row for each set of open weights Fuobe runs: 95 allow commercial use, 37 with conditions, 48 are non-commercial and 22 aren't available everywhere.| Model | By | Kind | Licence | Note || --- | --- | --- | --- | --- |@@ -196,9 +196,12 @@ Some licences ask the app that runs their model to say so.| FLUX.2 [klein] Try-On | Black Forest Labs × xocialize | Image | [Apache-2.0 (FLUX.2 [klein] 4B, try-on LoRA by xocialize); segformer_b2_clothes MIT; ComfyUI-RMBG code GPL-3.0](https://spdx.org/licenses/Apache-2.0.html) | || Qwen-Image 2.1 Outfit Swap | Alibaba Qwen × AusBoss | Image | [Qwen Research License Agreement (Qwen-Image 2.1 and the Outfit Swap LoRA by AusBoss, a derivative): NON-COMMERCIAL, research and evaluation only](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || Qwen-Image-Edit Product Shot | Alibaba Qwen × dx8152 | Image | [Apache-2.0 (Qwen-Image-Edit-2509, White_to_Scene and Lightning LoRAs); BiRefNet MIT](https://spdx.org/licenses/Apache-2.0.html) | |+| Qwen-Image 2.1 Steam It | Alibaba Qwen | Image | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; SAM 3.1 under Meta's SAM License (commercial use allowed under its terms); AusBoss nodes MIT](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || Z-Image Turbo · Grid | Alibaba Tongyi | Image | [Apache-2.0 (Z-Image Turbo)](https://spdx.org/licenses/Apache-2.0.html) | || Z-Image Turbo · Soul Cast sheet | Alibaba Tongyi | Image | [Apache-2.0 (Z-Image Turbo)](https://spdx.org/licenses/Apache-2.0.html) | || Pixelate faces | Meta SAM 3.1 + ComfyUI | Image | [Meta SAM License (SAM 3.1: royalty-free, commercial use allowed; attribution + acceptable-use terms)](https://huggingface.co/Comfy-Org/sam3.1) | Conditions apply |+| Find watermarks | Qwen3-VL + ComfyUI | Text | [Qwen3-VL 8B Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT](https://spdx.org/licenses/Apache-2.0.html) | |+| Watermark Remover | Qwen-Image 2.1 + ComfyUI | Image | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || FLUX.2 [dev] Image Edit (1 reference) | Workflow library | Edit | [FLUX [dev] Non-Commercial License (FLUX.2 [dev]): NON-COMMERCIAL](https://huggingface.co/black-forest-labs/FLUX.2-dev) | Non-commercial || Qwen-Image-Edit 2509 (Lightning 4-step) | Workflow library | Edit | [Apache-2.0 (Qwen-Image 2512 / Qwen-Image-Edit, Lightning LoRAs, Qwen2.5-VL text encoder)](https://spdx.org/licenses/Apache-2.0.html) | || Qwen-Image-Edit 2511 | Workflow library | Edit | [Apache-2.0 (Qwen-Image 2512 / Qwen-Image-Edit, Lightning LoRAs, Qwen2.5-VL text encoder)](https://spdx.org/licenses/Apache-2.0.html) | |@@ -214,6 +217,7 @@ Some licences ask the app that runs their model to say so.| Frame Interpolation (RIFE 4.26, native) | Workflow library | Interpolate | [MIT (RIFE)](https://spdx.org/licenses/MIT.html) | || Frame Interpolation (RIFE VFI custom pack) | Workflow library | Interpolate | [MIT (RIFE)](https://spdx.org/licenses/MIT.html) | || YuE2 3B: a cover of a song (its melody, new style and lyrics) | Workflow library | Music | [CC-BY-NC-4.0 (m-a-p/YuE2-3B @ 8f24312f and m-a-p/SheetSage2 @ b83c3d79 weights; the Comfy-Org/YuE2 repack @ 2f76ca75 is tagged the same)](https://spdx.org/licenses/CC-BY-NC-4.0.html) | Non-commercial |+| Remove what was brushed, the rest unchanged (Qwen-Image 2.1, ComfyUI-Qwen-Watermark) | Workflow library | Watermark remove | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || Qwen-Image 2.1 Text to Image · 2 steps, DMD2 LoRA v1.5 | Workflow library | T2I | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; linoyts' DMD2 2-step LoRA v1.5, a derivative of Qwen-Image 2.1 under the same Qwen Research License (card and NOTICE); Texture-Fix VAE (madebyollin @ 9a10df81, optional: Options → Decoder Clean): Qwen Research License (card: license_name qwen-research)](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || Qwen-Image 2.1 Text to Image · 4 steps, LightX2V Lightning LoRA | Workflow library | T2I | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; LightX2V Lightning LoRA: no licence in the repository (no LICENSE file, empty card tag; comfyui-wiki says Apache-2.0); a Qwen-Image 2.1 adapter, so the base's Qwen Research License applies to what it runs on; Texture-Fix VAE (madebyollin @ 9a10df81, optional: Options → Decoder Clean): Qwen Research License (card: license_name qwen-research)](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial || Qwen-Image 2.1 Text to Image · 6 steps, P-Q-Image v0.2 upsampled LoRA (writes the details) | Workflow library | T2I | [Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; PrunaAI's P-Q-Image-2.1 v0.2, a derivative of Qwen-Image 2.1 under the Qwen Research License (LICENSE and NOTICE in the repository); Texture-Fix VAE (madebyollin @ 9a10df81, optional: Options → Decoder Clean): Qwen Research License (card: license_name qwen-research)](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE) | Non-commercial |@@ -262,6 +266,7 @@ The custom nodes Fuobe's workflows install, with their licences.| [zen-image-edit-comfyui](https://github.com/recoilme/zen-image-edit-comfyui/tree/7a29e58c973b84798df926e3251727884fdacc2d) | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | Zen Image Edit's adapter loader and text encode: Qwen-Image 2.1 on the Qwen3.5-0.8B encoder (Apache-2.0) and a fusion adapter. The adapter and the Qwen-Image 2.1 weights are non-commercial (Qwen Research License) || [ComfyUI-QwenTTS](https://github.com/1038lab/ComfyUI-QwenTTS/tree/d8122a8ba835b65fd65c113d2b273b1ad1579293) | [GPL-3.0](https://spdx.org/licenses/GPL-3.0-only.html) | Qwen3-TTS voice design and voice clone nodes; GPL-3.0 code. The Qwen3-TTS 1.7B weights it downloads are Apache-2.0 || [ComfyUI-VoxCPM2](https://github.com/Saganaki22/ComfyUI-VoxCPM2/tree/0e52a6cd006769e030d0e1ae907ffebbbfac4f5f) | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | VoxCPM2 text to speech (voice design) and voice clone nodes; Apache-2.0 code. The VoxCPM2 weights it downloads are Apache-2.0 |+| [ComfyUI-Qwen-Watermark](https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34) | [MIT](https://spdx.org/licenses/MIT.html) | The Watermark Remover's nodes: find the marks (Qwen3-VL 8B, Apache-2.0), outline stickers (SAM ViT-B, Apache-2.0), repair and check the result; MIT code. The Qwen-Image 2.1 weights the repair runs are non-commercial || [h3_character_swap](https://github.com/akatz-labs/h3-character-swap-tool/tree/0670e4fdf95adf2262caa4b81afed2a9c4ae4b7b/worker_nodes/h3_character_swap) | [GPL-3.0](https://spdx.org/licenses/GPL-3.0-only.html) | MiniMax H3 character swap nodes (Akatz Labs); GPL-3.0 code, a modified NVIDIA INT8 kernel inside is Apache-2.0. The MiniMax H3 weights it runs leave out the US, the EU, the UK and South Korea || [h3-relay](https://github.com/akatz-ai/h3-relay/tree/e2a7665b6eb8ea37a88c0de2c9c6b69a8f7c9220) | [GPL-3.0](https://spdx.org/licenses/GPL-3.0-only.html) | H3 Relay 2.0 (Sendy Software LLC and contributors); GPL-3.0 code, vendored Context Loop and Spectrum GPL-3.0. Opt-in (H3_RELAY=1): it registers HTTP routes when it loads || [ComfyUI-MiniMaxH3-Context-Loop](https://github.com/ethanfel/ComfyUI-MiniMaxH3-Context-Loop/tree/43afeffcc570beb5f7382593e79e4b211c7e02f6) | [GPL-3.0](https://spdx.org/licenses/GPL-3.0-only.html) | MiniMax H3 Context Loop (NikoDemon80, Ethanfel): long H3 edits clip by clip, each continuing from the last; GPL-3.0 code. It registers local HTTP routes when it loads |diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex c6ba2c43..9d5cd34f 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -75,7 +75,7 @@ Feed, Library, studios (React Query caches patched by id; polls every 10 s while| `storyboard.ts` | Storyboard models per engine, scene splitting and frame prompts. Since round 5 part 1 (O13, Popcorn) `planStoryboard` writes each frame's request: Fuobe's open recipe on both engines (`STORYBOARD_MODELS`: in the cloud Z-Image Turbo, or Qwen-Image-Edit 2511 with references, then Qwen-Image-Edit 2509 with the next-scene LoRA, `nextLoras`), Nano Banana Pro as a cloud partner for every frame (`STORYBOARD_PARTNERS`), and a Fuobe Soul look (frame 1 on `fuobe-soul` without references, the look's words on the next frames, `frame.look`; a 21:9 look board made at 16:9 and cropped, `LOOK_CROPPED`) || `training.ts` | Fuobe Soul ID (round 4 part 4; see Training): the 7 families (`TRAINING_FAMILIES`: each base's models, lead model and fal trainer), the 13 targets (`TRAINING_TARGETS`: 5 AI-Toolkit, 8 fal), the photo rules and consent line (`SOUL_ID_PHOTOS`, `SOUL_ID_COPY`, `needsConsent`), prices (`trainerCost`), `falTrainingInput` and `trainedLoraUrl`, `AITK_MODELS` and `aiToolkitJob` (character or style preset), `identityFor` (an element's LoRA for a model's family), `trainingCaption`. Higgsfield Soul ID is no longer a target || `character-swap.ts` | Round 4 part 4. Genjutsu's Character swap, pure (see Fuobe Originals): limits (`CHARACTER_SWAP`), who to swap, the H3 window plan and canvas (`windowPlan`, `h3Canvas`, `samCoords`), prompts (`swapPrompt`, `anchorPrompt`), the anchor models, the swap, Turbo and Person Remover LoRAs with their pinned files (`SWAP_LORAS`, `TURBO_LORA`, `PERSON_REMOVER_LORA`, `graphLoras`) and the licences as data (`CHARACTER_LICENCES`, `MINIMAX_H3_LICENCE`); since round 4 part 5 `H3_WORKFLOWS` also names Character Swap Studio's segment graph, so its LoRAs download before a run |-| `apps.ts`, `motions.ts` | 125 apps, 108 camera motions, 255 effects: prompt templates, input slots, option pickers, cloud and open routes. `APP_ALIASES` keeps renamed app ids working. Since round 4 part 3 `index.ts` rebuilds every motion's and effect's routes with `dopPreset` (`dop.ts`). Since round 5 part 1 the Fuobe Angles app (`app-fuobe-angles`, badges new and beta) sits next to the Angles app, which keeps its Qwen-Image-Edit 2511 recipe (`ANGLES_2511_LORA`), and the AI Influencer app's routes carry the casting look (`PresetRoute.look`: `CAST_LOOK`, the Realistic look) |+| `apps.ts`, `motions.ts` | 126 apps, 108 camera motions, 255 effects: prompt templates, input slots, option pickers, cloud and open routes. `APP_ALIASES` keeps renamed app ids working. Since round 4 part 3 `index.ts` rebuilds every motion's and effect's routes with `dopPreset` (`dop.ts`). Since round 5 part 1 the Fuobe Angles app (`app-fuobe-angles`, badges new and beta) sits next to the Angles app, which keeps its Qwen-Image-Edit 2511 recipe (`ANGLES_2511_LORA`), and the AI Influencer app's routes carry the casting look (`PresetRoute.look`: `CAST_LOOK`, the Realistic look) || `engines.ts` | Round 4 part 3. Pure: which engine a model runs on. `enginesOf`, `runsOn`, `dualEngine`, `providerEngine`, `onEngine` (an Original as it runs on one engine) and `pickEngine` (see Fuobe Originals) || `swap-studio.ts`, `swap-studio-plan.ts`, `swap-studio-edit.ts` | Round 4 part 5. Character Swap Studio, pure (see Studios): the project document and its rules, every job's steps on each engine, and the page's edits || `soul.ts`, `soul-cards.ts` | Round 4 part 3. Fuobe Soul: `soulRecipe` (the look's words, LoRAs in slot order, tail, grade, overlay), `soulSize` / `soulMegapixels` (`FAL_MEGAPIXEL`), `promptWithLoras`, `soulPostSteps`, legacy id lookup. `soul-cards.ts` is the browser-safe part: look cards for the pickers, `DEFAULT_LOOK` (`v1-general`), the model ids; since round 4 part 4 `OWN_LOOK` (`own-style`: a moodboard trained as a style LoRA is the look; its LoRA carries it, with no look words, look LoRAs or grade). Since round 5 part 1 a look can name a step after it (`SoulLook.post`, read by `soulPostStep`: PixeletedFace's `face-mosaic`, from the research's `presets[].post`) |diff --git a/docs/FEATURES.md b/docs/FEATURES.mdindex 7a52dca1..fee54690 100644--- a/docs/FEATURES.md+++ b/docs/FEATURES.md@@ -2,7 +2,7 @@[← README](../README.md) · [Setup and self-hosting](SELF-HOSTING.md) · [Development](DEVELOPMENT.md) · [Status](STATUS.md)-Fuobe is a complete creative studio you can run yourself: 108 camera motions, 255 effects and 125 apps, Cinema, Shorts, Marketing and Ads studios, Layers, Canvas, Storyboard, Image to 3D, voice and music tools, and an Assist agent that plans and runs whole jobs. Every tool runs either on open-weight models on your own GPU through **ComfyUI**, or on frontier models with your own fal.ai / Replicate key. Flip one switch. Licences are information, not gates: **Settings → Models & licences** shows the licence of every model, LoRA and node pack.+Fuobe is a complete creative studio you can run yourself: 108 camera motions, 255 effects and 126 apps, Cinema, Shorts, Marketing and Ads studios, Layers, Canvas, Storyboard, Image to 3D, voice and music tools, and an Assist agent that plans and runs whole jobs. Every tool runs either on open-weight models on your own GPU through **ComfyUI**, or on frontier models with your own fal.ai / Replicate key. Flip one switch. Licences are information, not gates: **Settings → Models & licences** shows the licence of every model, LoRA and node pack.**Every preview on the site was rendered locally on ComfyUI** with open weights: stills with Ideogram 4, before/after end frames with Qwen Image 2.1 edits, and the motion clips with MiniMax H3 (including its Orbit LoRA for bullet time), all on one RTX 5090.@@ -96,7 +96,7 @@ Fuobe is a complete creative studio you can run yourself: 108 camera motions, 25## Catalog and the open-source engine-- **Catalog:** 198 cloud models + 104 open-source models + 20 Fuobe Originals that run on both (plus 54 hidden ones: chain steps and studio helpers such as the fly path's two routes, self-tests, browser tools, and Gemma 4 speech translate, which no studio uses yet), 125 apps, 108 camera motions (mix any two), 255 effects; 480 of their cards show a cover rendered on a GPU (48 of them short clips), the rest a drawn preview. A launch price (FLUX 3 Max's, through 2026-11-07) is read on the day: a run is priced on the day it is planned, and a page shows that day's price once it has loaded, never one read while the page was built+- **Catalog:** 198 cloud models + 104 open-source models + 20 Fuobe Originals that run on both (plus 56 hidden ones: chain steps and studio helpers such as the fly path's two routes and the Watermark Remover's two steps, self-tests, browser tools, and Gemma 4 speech translate, which no studio uses yet), 126 apps, 108 camera motions (mix any two), 255 effects; 480 of their cards show a cover rendered on a GPU (48 of them short clips), the rest a drawn preview. A launch price (FLUX 3 Max's, through 2026-11-07) is read on the day: a run is priced on the day it is planned, and a page shows that day's price once it has loaded, never one read while the page was built- **Open-source engine:** 174 API-format ComfyUI workflows (official templates, community packs and hand-built graphs), 152 of them validated against real ComfyUI node definitions (the 16 graphs of the newest image models, and MOSS-Image's since its encoder became the int8 file, were checked only against a ComfyUI's node list, and wait for a check on one that isn't busy; the three MiniMax H3 graphs and the Character Swap Studio's two H3 Relay graphs need node packs the validation server doesn't have; Split soundtrack's DBS graph was checked, and ran, on a separate CPU ComfyUI with ComfyUI-DBS), plus 84 researched LoRAs (camera moves, VFX) that 122 motion, effect and app presets use today (43 of them are also in the Settings → LoRAs library, and 36 come from civitai)## Evaluation harnessdiff --git a/docs/STATUS.md b/docs/STATUS.mdindex c83f3388..58e52850 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -138,7 +138,7 @@ Model names are the defaults first, then the alternatives. "Demo" outputs are la| Image to 3D / product spin, plus 3D from several photos, from text, a picked object, splats, rigging | 🟢 | From an image: Hunyuan3D 3.1 Pro (default) / Rapid, TRELLIS.2, Tripo H3.1, Meshy 7.1. From several images: Meshy 7.1 Multi-view (≈ $1.20). From text: Tripo H3.1 (≈ $0.20). Pick an object: SAM 3D Objects, now asked for a textured GLB. Splat: TripoSplat ($0.05). Rig & animate: Meshy Rigging ($0.20, +$0.12 with an animation) | From an image: Pixal3D (default: MoGe-2 camera, ~250k-triangle textured GLB; its own 5.58 GB download), TRELLIS.2 (the fallback, MIT), Hunyuan3D 2.1 (shape only, territory-restricted licence). From several images: TRELLIS.2 Multi-view (the front plus 1–3 sides; a 5.58 GB download; 16 GB VRAM, unverified). From text: Z-Image Turbo draws the object, then TRELLIS.2 builds it. Splat: TripoSplat (.spz + an orbit video). No open Pick an object or rigging; the page offers the cloud or From an image. Before an open GLB job shows as done, the server finishes the model in about a second (`src/server/model3d-finish.ts`: roughness floor by material, pivot at the bottom, meshopt + WebP web GLB); after it, one at a time and at low priority, it renders a 96-frame 24 fps turntable on the CPU when Chromium and ffmpeg are there, and adds it to the result (the card shows its progress), in place of the one the multi-view graph renders | `/image-to-3d` and an app: a mode picker (From an image, From several images, From text, Pick an object, Splat; also `?mode=` and `?model=`), the price before you run, licence lines for open models, cards that play the turntable, the orbitable viewer (the web GLB, with the meshopt decoder from `/vendor`), which loads only when opened, downloads (the raw GLB), turntable (the server's, TripoSplat's orbit, or recorded in the browser: 96 frames, 24 fps, WebCodecs), "Animate the spin". Rig & animate on a finished model: a skeleton with walk and run cycles, or one of 30 curated Meshy animations in 6 groups (any other by its number, up to 696); the dialog starts on Casual walk ($0.32); a rigged model plays its animation here and in the Library. A splat gets a .spz / .ply download and a pointer to a viewer such as SuperSplat; Fuobe doesn't draw splats yet. A cloud model's extra formats (OBJ, FBX, USDZ…) and previews are now stored with the result. "Built with DINOv3" shows under TRELLIS.2 and TripoSplat results on both engines, and under Pixal3D's. Checked in demo mode, and the finish, the turntable runner and the browser recorder by tests (`model3d-finish`, `model3d-runner`, `model3d-webm`); no GPU or paid run through Fuobe yet || Vectorize (image → SVG) | ✅ open · 🟢 cloud | Recraft Vectorize | VTracer through ComfyUI (ComfyUI-ToSVG; no AI model) | The Vectorize app (Utility). VTracer is crisp on logos and flat art and makes many small shapes on photos. SVG results are stored as .svg and offer Download and Favorite, not raster hand-offs. VTracer ran on a CPU ComfyUI || Try-On, Angles, Product Shot apps | 🟢 | FASHN Try-On 1.6 (also Google, Leffa); Qwen Multiple Angles (rotate / tilt / zoom); Bria Product Shot. **Fuobe Angles** (new app, beta; round 5, part 1, O11): fal's Qwen-Image-Edit 2509 multiple-angles at about 1 MP, $0.035 | FLUX.2 [klein] 4B + try-on LoRA; Qwen-Image-Edit 2511 + Multiple-Angles LoRA; Qwen-Image-Edit 2509 + White_to_Scene LoRA. Fuobe Angles: Qwen-Image-Edit 2509 with the Lightning LoRA and dx8152's Multiple-angles LoRA (`qwen-image-edit-2509-angles`, 24 GB; one new 0.24 GB file), free | The notes say what the open route runs. Try-on needs the person and the garment; the Virtual Try-On app's GPU route now fetches its try-on LoRA through the LoRA library, under its Settings switch. **Fuobe Angles** sits next to Angles: Rotate (90° left to 90° right), Camera height, Distance and Lens, plus a note used on your GPU only (fal's route takes no prompt, and the plan says so); a camera that doesn't move, with no note, is refused. The Angles app keeps its Qwen-Image-Edit 2511 recipe until the `angles` suite measures Fuobe Angles. Checked in demo mode (`open-tools.mjs`) |-| Relight, Skin Enhancer, Headshots, Packshot, Face/Character Swap, Transitions… | 🟢 | 125 apps: 123 on both engines, 2 open-only | Relight LoRA, ReActor, Qwen-Image-Edit… | Match Lighting, Match Colors, Hook Frame (formerly the Virality Predictor app; its old `/apps/app-virality-predictor` URL now redirects to `/virality`), Vectorize, Fuobe Angles (new, beta) |+| Relight, Skin Enhancer, Headshots, Packshot, Face/Character Swap, Transitions… | 🟢 | 126 apps: 123 on both engines, 3 open-only | Relight LoRA, ReActor, Qwen-Image-Edit… | Match Lighting, Match Colors, Hook Frame (formerly the Virality Predictor app; its old `/apps/app-virality-predictor` URL now redirects to `/virality`), Vectorize, Fuobe Angles (new, beta) || Approximated apps | 🟡 | — | — | 16 apps are marked as approximations on their page (e.g. one silent clip where Higgsfield beat-matches several), out of 43 with a parity note (what the Fuobe or open version does differently) |### Characters, lipsync, audiodiff --git a/scripts/comfy/README.md b/scripts/comfy/README.mdindex 869ae0b9..b78c7629 100644--- a/scripts/comfy/README.md+++ b/scripts/comfy/README.md@@ -606,6 +606,32 @@ from an example and not rendered yet.- **GPU**: 20–24 GB estimates (`vramGb`), none measured here. ComfyUI 0.42.0 or newer: `TextEncodeQwenImage21`,`QwenImage21Cache`, `Ideogram4Scheduler`, `DualModelGuider`, `CFGOverride` and `TextEncodeFibo2` came with it.+## Watermark Remover (ComfyUI-Qwen-Watermark)++Three hand-built graphs from overflowofedge's ComfyUI-Qwen-Watermark (MIT, pinned at `eef829d3`) for the Watermark Remover+app (`app-watermark-remover`, its own page in `src/components/watermark`). The page runs a scan, shows the marks it found,+and removes the ones the visitor didn't keep; a brush covers anything missed. Both steps are ordinary runs on the person's+own GPU (`POST /api/generations`).++| id | capability | what it does |+|---|---|---|+| `image-watermark-scan-qwen3vl` | watermark-scan | `QWMDetect` auto_qwen (Qwen3-VL 8B int8, one pass); the report (`PreviewAny`) is the only output: boxes in pixels with their type, a tight `source_bbox` and the less sure `rejected_boxes` |+| `image-watermark-remove-qwen21` | watermark-remove | `QWMDetect` manual_boxes with the kept marks (`boxes`, `detectMode`), a rectangle or a SAM ViT-B outline per mark, Qwen-Image 2.1 int8 repair at `maxSize`, a leftover check and at most one more pass; `QWMFinal` refuses to change any pixel outside the mask. Its report (role `quality`) is folded into the picture's meta |+| `image-watermark-remove-qwen21-brush` | watermark-remove | the same with a painted mask (`LoadImageMask`, red, white = remove) into `QWMDetect` manual_mask; `src/lib/comfy-variants.ts` runs it when a request carries a mask |++The provider fills `boxes` (checked and rebuilt by `src/lib/watermark.ts`, clamped to the picture), `detectMode` and `maxSize`+(1024; 1536 past 3000 px; 768 on a GPU under 16 GB) and draws both seeds at random. The GPU pre-flight checks the removal+along with a scan (`COMPANION_GRAPHS`), so nobody is stopped after the first step.++The pack's `requirements.txt` is not installed (its `opencv-contrib-python-headless` next to `opencv-python` can leave `cv2`+broken): `packs.json` names `pip: ["segment-anything==1.0"]` instead, which the setup commands install by name. SAM ViT-B+comes from a Hugging Face mirror (`ybelkada/segment-anything`) at a pinned revision whose SHA-256 is Meta's file's+(`ec2df627…`). ComfyUI lists `models/sams` only when a pack registers the folder, so its presence is `unobservable`.++They were built with a stand-in for `/object_info` (the committed subset) and are `validated: false` until+`node validate-workflows.mjs image-watermark-scan-qwen3vl image-watermark-remove-qwen21 image-watermark-remove-qwen21-brush --shared`+runs on a ComfyUI 0.42 with the pack installed.+## Adding a workflow1. Find the template name in `$COMFYUI_DIR/.venv/lib/python3.*/site-packages/comfyui_workflow_templates_json/templates/index.json`diff --git a/scripts/comfy/build-library.mjs b/scripts/comfy/build-library.mjsindex c18fcbae..5ddcbab7 100644--- a/scripts/comfy/build-library.mjs+++ b/scripts/comfy/build-library.mjs@@ -82,6 +82,8 @@ export const LOADER_FOLDERS = {OpenH3RegenFastVAEDecode: { vae_name: 'vae' },// Clean up voice: ComfyUI-RE-USE's loader reads models/reuse.REUSELoader: { model: 'reuse' },+ // Watermark Remover: ComfyUI-Qwen-Watermark's mask refiner reads SAM from models/sams.+ QWMRefineMask: { sam_model: 'sams' },};// Nodes that fetch their own weights at runtime (no manual download needed; listed in the entry's autoDownloads).// Zen Image Edit's adapter loader reads paths: its adapter is a requiredModels file, Qwen3.5-0.8B its autoDownloads.@@ -188,6 +190,8 @@ export const BINDING_KEYS = new Set(['maskBlur', 'pasteBack',// Photo to 3D (Idol): SplatToMesh's grid and the turn that faces the subject's front'meshDetail', 'frontYaw',+ // Watermark Remover (ComfyUI-Qwen-Watermark): the kept marks and how the pack finds what to repair+ 'boxes', 'detectMode',]);// Sizes in GB: two decimals, and three where two would read 0 (a 4 MB DBS model), so no other entry's size changes.diff --git a/scripts/comfy/build-requirements.mjs b/scripts/comfy/build-requirements.mjsindex 1d5e4416..64cf1594 100644--- a/scripts/comfy/build-requirements.mjs+++ b/scripts/comfy/build-requirements.mjs@@ -26,6 +26,12 @@ export const LIBRARY = path.join(REPO, 'workflows', 'comfyui');/** ComfyUI's folder_paths.supported_pt_extensions: the files a folder listing shows. */export const PT_EXTENSIONS = ['.ckpt', '.pt', '.pt2', '.bin', '.pth', '.safetensors', '.pkl', '.sft'];+/**+ * Folders ComfyUI lists only when a loaded pack registers them (GET /models/<folder>): ComfyUI-Qwen-Watermark reads+ * models/sams by its path without registering it, so a listing can't tell whether its SAM file is there.+ */+const UNLISTED_FOLDERS = new Set(['sams']);+/** Core classes of the newest families, read one by one when /object_info can't be: an older ComfyUI lacks them first. */const NEWEST_CORE = /^(SeedVR2|Trellis2|SAM3|LTXV|LTXAV|ComfyMathExpression|TextEncodeQwenImage21|QwenImage21Cache|Ideogram4|TextEncodeFibo2|DualModelGuider|CFGOverride)/;const NEWEST_CORE_MODULES = new Set(['comfy_extras.nodes_bg_removal']);@@ -136,7 +142,7 @@ export function buildIndex({ manifest, graphs, subset, packs, pins, packClasses}}const ext = path.extname(r.file).toLowerCase();- const presence = loaders.size ? 'loader' : PT_EXTENSIONS.includes(ext) ? 'list' : 'unobservable';+ const presence = loaders.size ? 'loader' : PT_EXTENSIONS.includes(ext) && !UNLISTED_FOLDERS.has(r.folder) ? 'list' : 'unobservable';files[key] = {folder: r.folder,file: r.file,@@ -210,6 +216,8 @@ export function buildIndex({ manifest, graphs, subset, packs, pins, packClasses// One node file in a model repo (viggle_turbo): downloaded, not cloned....(p.file && { file: p.file }),requirementsTxt: !!p.requirementsTxt,+ // Python packages to install by name instead of the pack's requirements.txt (pinned versions only).+ ...(Array.isArray(p.pip) && p.pip.length && { pip: [...p.pip] }),install: p.registry?.version ? 'registry' : 'manual',};}diff --git a/scripts/comfy/hand-built/image-watermark-remove-qwen21-brush.json b/scripts/comfy/hand-built/image-watermark-remove-qwen21-brush.jsonnew file mode 100644index 00000000..6473851b--- /dev/null+++ b/scripts/comfy/hand-built/image-watermark-remove-qwen21-brush.json@@ -0,0 +1,442 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "manual_mask",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "50",+ 0+ ],+ "min_confidence": 0.65+ }+ },+ "4": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "3",+ 0+ ],+ "boxes_json": [+ "3",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 12,+ "adaptive_dilation": true+ }+ },+ "5": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "context_pixels": 96,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 5,+ "edit_prompt": [+ "3",+ 3+ ],+ "boxes_json": [+ "3",+ 1+ ]+ }+ },+ "6": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ }+ },+ "7": {+ "class_type": "ModelAttentionBackend",+ "inputs": {+ "model": [+ "6",+ 0+ ],+ "attention": "comfy kitchen attention"+ }+ },+ "8": {+ "class_type": "QwenImage21Cache",+ "inputs": {+ "model": [+ "7",+ 0+ ],+ "device": "off",+ "dtype": "default"+ }+ },+ "9": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ }+ },+ "10": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "5",+ 0+ ],+ "prompt": [+ "5",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,残留动物或人物,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "12": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "10",+ 0+ ],+ "negative": [+ "10",+ 1+ ],+ "latent_image": [+ "10",+ 2+ ],+ "seed": 802146,+ "steps": 20,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "13": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "12",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "14": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "edited_crop": [+ "13",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "geometry": [+ "5",+ 2+ ],+ "feather": 6,+ "align": true,+ "color_match": true+ }+ },+ "26": {+ "class_type": "QWMResidualDetect",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "detection_side": 1024,+ "expand": 24,+ "max_tokens": 384,+ "edit_prompt": "",+ "allowed_mask": [+ "4",+ 0+ ],+ "enabled": true,+ "min_confidence": 0.8,+ "first_report": [+ "14",+ 2+ ],+ "original_image": [+ "1",+ 0+ ]+ }+ },+ "27": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "26",+ 0+ ],+ "boxes_json": [+ "26",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 8,+ "adaptive_dilation": false+ }+ },+ "28": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "context_pixels": 128,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 3,+ "edit_prompt": [+ "26",+ 3+ ],+ "boxes_json": [+ "26",+ 1+ ]+ }+ },+ "29": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "28",+ 0+ ],+ "prompt": [+ "28",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,重影,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "30": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "29",+ 0+ ],+ "negative": [+ "29",+ 1+ ],+ "latent_image": [+ "29",+ 2+ ],+ "seed": 240517,+ "steps": 16,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "31": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "30",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "32": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "14",+ 0+ ],+ "edited_crop": [+ "31",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "geometry": [+ "28",+ 2+ ],+ "feather": 4,+ "align": true,+ "color_match": true+ }+ },+ "33": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "37",+ 0+ ],+ "filename_prefix": "fuobe/image-watermark-remove-qwen21-brush"+ }+ },+ "37": {+ "class_type": "QWMFinal",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "initial_mask": [+ "4",+ 0+ ],+ "detection_report": [+ "3",+ 1+ ],+ "first_pass": [+ "14",+ 0+ ],+ "first_report": [+ "14",+ 2+ ],+ "residual_report": [+ "26",+ 1+ ],+ "second_pass": [+ "32",+ 0+ ],+ "second_report": [+ "32",+ 2+ ],+ "residual_mask": [+ "27",+ 0+ ]+ }+ },+ "38": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "37",+ 2+ ]+ }+ },+ "50": {+ "class_type": "LoadImageMask",+ "inputs": {+ "image": "example_mask.png",+ "channel": "red"+ }+ }+}diff --git a/scripts/comfy/hand-built/image-watermark-remove-qwen21.json b/scripts/comfy/hand-built/image-watermark-remove-qwen21.jsonnew file mode 100644index 00000000..91936c13--- /dev/null+++ b/scripts/comfy/hand-built/image-watermark-remove-qwen21.json@@ -0,0 +1,435 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "auto_qwen",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "1",+ 1+ ],+ "min_confidence": 0.65+ }+ },+ "4": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "3",+ 0+ ],+ "boxes_json": [+ "3",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 12,+ "adaptive_dilation": true+ }+ },+ "5": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "context_pixels": 96,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 5,+ "edit_prompt": [+ "3",+ 3+ ],+ "boxes_json": [+ "3",+ 1+ ]+ }+ },+ "6": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ }+ },+ "7": {+ "class_type": "ModelAttentionBackend",+ "inputs": {+ "model": [+ "6",+ 0+ ],+ "attention": "comfy kitchen attention"+ }+ },+ "8": {+ "class_type": "QwenImage21Cache",+ "inputs": {+ "model": [+ "7",+ 0+ ],+ "device": "off",+ "dtype": "default"+ }+ },+ "9": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ }+ },+ "10": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "5",+ 0+ ],+ "prompt": [+ "5",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,残留动物或人物,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "12": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "10",+ 0+ ],+ "negative": [+ "10",+ 1+ ],+ "latent_image": [+ "10",+ 2+ ],+ "seed": 802146,+ "steps": 20,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "13": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "12",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "14": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "edited_crop": [+ "13",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "geometry": [+ "5",+ 2+ ],+ "feather": 6,+ "align": true,+ "color_match": true+ }+ },+ "26": {+ "class_type": "QWMResidualDetect",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "detection_side": 1024,+ "expand": 24,+ "max_tokens": 384,+ "edit_prompt": "",+ "allowed_mask": [+ "4",+ 0+ ],+ "enabled": true,+ "min_confidence": 0.8,+ "first_report": [+ "14",+ 2+ ],+ "original_image": [+ "1",+ 0+ ]+ }+ },+ "27": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "26",+ 0+ ],+ "boxes_json": [+ "26",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 8,+ "adaptive_dilation": false+ }+ },+ "28": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "context_pixels": 128,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 3,+ "edit_prompt": [+ "26",+ 3+ ],+ "boxes_json": [+ "26",+ 1+ ]+ }+ },+ "29": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "28",+ 0+ ],+ "prompt": [+ "28",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,重影,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "30": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "29",+ 0+ ],+ "negative": [+ "29",+ 1+ ],+ "latent_image": [+ "29",+ 2+ ],+ "seed": 240517,+ "steps": 16,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "31": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "30",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "32": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "14",+ 0+ ],+ "edited_crop": [+ "31",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "geometry": [+ "28",+ 2+ ],+ "feather": 4,+ "align": true,+ "color_match": true+ }+ },+ "33": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "37",+ 0+ ],+ "filename_prefix": "fuobe/image-watermark-remove-qwen21"+ }+ },+ "37": {+ "class_type": "QWMFinal",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "initial_mask": [+ "4",+ 0+ ],+ "detection_report": [+ "3",+ 1+ ],+ "first_pass": [+ "14",+ 0+ ],+ "first_report": [+ "14",+ 2+ ],+ "residual_report": [+ "26",+ 1+ ],+ "second_pass": [+ "32",+ 0+ ],+ "second_report": [+ "32",+ 2+ ],+ "residual_mask": [+ "27",+ 0+ ]+ }+ },+ "38": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "37",+ 2+ ]+ }+ }+}diff --git a/scripts/comfy/hand-built/image-watermark-scan-qwen3vl.json b/scripts/comfy/hand-built/image-watermark-scan-qwen3vl.jsonnew file mode 100644index 00000000..0cba1985--- /dev/null+++ b/scripts/comfy/hand-built/image-watermark-scan-qwen3vl.json@@ -0,0 +1,51 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "auto_qwen",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "1",+ 1+ ],+ "min_confidence": 0.65+ }+ },+ "23": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "3",+ 1+ ]+ }+ }+}diff --git a/scripts/comfy/install-comfyui.sh b/scripts/comfy/install-comfyui.shindex 4d872b2b..6df15fec 100755--- a/scripts/comfy/install-comfyui.sh+++ b/scripts/comfy/install-comfyui.sh@@ -48,6 +48,11 @@ declare -A NODES=(# dependencies) and PlagueKind's SLA attention and AdaLN LoRA fix (MIT, v1.5.6; the SLA kernel imports triton, installed below).[ComfyUI-MiniMax-H3-Turbo]="https://github.com/Larryvrh/ComfyUI-MiniMax-H3-Turbo 77bfa67575b14e3be6214f1747732e540c68b5dd"[plaguekind-nodes]="https://github.com/PlagueKind/ComfyUI-PlagueKind-Nodes d58d006a4ea32c25c06499f2ff104f0852a045a6"+ # Watermark Remover (image-watermark-*): overflowofedge's Qwen watermark nodes (MIT), read at this commit (no network,+ # subprocess, eval or file writes). Its requirements.txt is NOT installed: it asks for opencv-contrib-python-headless,+ # which next to opencv-python can leave cv2 broken; core cv2 has every function it uses, and segment-anything is in the+ # union below. Its SAM ViT-B file goes in models/sams (SAM_WEIGHTS block at the end).+ [ComfyUI-Qwen-Watermark]="https://github.com/overflowofedge/ComfyUI-Qwen-Watermark eef829d34d6e9d0d2ae0c1386fab7371a864cf34")# Licences are information (Settings → Models & licences has the switches): every pack is installed, the# non-commercial ComfyUI-Whisper (CC-BY-NC-SA-4.0, used by the captions-whisper-burnin workflow) included.@@ -290,3 +295,19 @@ fi# --- end ComfyUI-RE-USEecho "ComfyUI installed in $COMFYUI_DIR. Start it with: $SCRIPT_DIR/start-comfyui.sh"++# --- SAM ViT-B (image-watermark-remove-qwen21: sticker outlines), 375 MB (Meta's file, from a pinned Hugging Face mirror), into models/sams, checked with+# sha256sum -c before it is kept (a .pth can run code when it loads). Only with REAL_MODELS=1 (validation needs no weights).+if [ "${REAL_MODELS:-0}" = "1" ]; then+ SAM_DIR="$COMFYUI_DIR/models/sams"+ mkdir -p "$SAM_DIR"+ if [ ! -s "$SAM_DIR/sam_vit_b_01ec64.pth" ]; then+ if curl -fsSL --retry 3 -o "$SAM_DIR/sam_vit_b_01ec64.pth.part" "https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth" \+ && (cd "$SAM_DIR" && echo "ec2df62732614e57411cdcf32a23ffdf28910380d03139ee0f4fcbe91eb8c912 sam_vit_b_01ec64.pth.part" | sha256sum -c --quiet); then+ mv "$SAM_DIR/sam_vit_b_01ec64.pth.part" "$SAM_DIR/sam_vit_b_01ec64.pth"+ else+ rm -f "$SAM_DIR/sam_vit_b_01ec64.pth.part"+ echo "warn: could not fetch SAM ViT-B (or it failed its SHA-256 check)"+ fi+ fi+fidiff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjsindex 75db97b3..c159c90e 100644--- a/scripts/comfy/library.spec.mjs+++ b/scripts/comfy/library.spec.mjs@@ -155,6 +155,12 @@// pasteBack (true: only the masked area comes from the edit, the rest is the input's pixels)// Keys added with the Outfit Swap app. Model settings (params.extra; the app's Shoes choice writes it):// request (the sentence after the swap: "Replace everything they wear." | "Keep their own shoes and legwear.")+// Keys added with the Watermark Remover (ComfyUI-Qwen-Watermark). * = the provider fills it:+// boxes* (QWMDetect boxes_json: the marks the visitor kept, params.extra.boxes, checked and rebuilt+// by src/lib/watermark.ts: pixels, 1-32 boxes clamped to the picture, known types only)+// detectMode* (QWMDetect mode: manual_boxes with boxes, manual_mask on the brush graph, else auto_qwen)+// maxSize* (here QWMPrepare max_side on both passes: 1024; 1536 past 3000 px; 768 on a GPU under 16 GB)+// Output role "quality": a node's JSON verdict on the run (QWMFinal), folded into the image outputs' meta.quality.import fs from 'node:fs';@@ -235,6 +241,9 @@ export const CUSTOM_NODE_REPOS = {'ComfyUI-H3-FaceRefine': 'https://github.com/Carasibana/ComfyUI-H3-FaceRefine','ComfyUI-Impact-Pack': 'https://github.com/ltdrdata/ComfyUI-Impact-Pack',comfyui_controlnet_aux: 'https://github.com/Fannovel16/comfyui_controlnet_aux/tree/a587a4c1594524c1d2de5cd1a86cd868ff448e1c',+ // Watermark Remover: overflowofedge's Qwen watermark nodes (MIT), read at this commit: no network, subprocess, eval or+ // file writes. Not on the validation server (the image-watermark-* entries list it with `packs`); pinned in install-comfyui.sh.+ 'ComfyUI-Qwen-Watermark': 'https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34',};// Node classes of the packs entries list in `packs` (packs the validation server doesn't have installed): the build@@ -272,6 +281,7 @@ export const PACK_CLASSES = {'ComfyUI-Impact-Pack': /^SAMLoader$/,comfyui_controlnet_aux: /^Metric3D-NormalMapPreprocessor$/,'ComfyUI-KJNodes': /^VRAM_Debug$/,+ 'ComfyUI-Qwen-Watermark': /^QWM(Detect|ResidualDetect|RefineMask|Prepare|Composite|Final)$/,};// Model download locations for files that the source workflow does not annotate@@ -284,6 +294,10 @@ export const KNOWN_MODELS = {'minimax_music3_dav.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/vae/minimax_music3_dav.safetensors' },'yue2_3b_int8_convrot.safetensors': { folder: 'checkpoints', url: 'https://huggingface.co/Comfy-Org/YuE2/resolve/main/checkpoints/yue2_3b_int8_convrot.safetensors' },'sheetsage2_bf16.safetensors': { folder: 'audio_encoders', url: 'https://huggingface.co/Comfy-Org/YuE2/resolve/main/audio_encoders/sheetsage2_bf16.safetensors' },+ // Watermark Remover: Meta's SAM ViT-B (Apache-2.0), the file ComfyUI-Qwen-Watermark's QWMRefineMask loads. Meta hosts it+ // outside Hugging Face, so this is ybelkada's mirror at a pinned revision: its LFS SHA-256 (ec2df627…) is Meta's file's, and+ // the setup commands check it (a .pth can run code when it loads).+ 'sam_vit_b_01ec64.pth': { folder: 'sams', url: 'https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth' },// archive-restore: Lightricks' Detail Refine IC-LoRA (stage 2 of Restore & colourise), gated, at the researched commit.'ltx-2.5-22b-ic-lora-refine-details-1.0.safetensors': { folder: 'loras', url: 'https://huggingface.co/Lightricks/LTX-2.5-22b-IC-LoRA-Refine-Details/resolve/4912c478b35dd96b6cdcc5f7c7ff9d72c2c57929/ltx-2.5-22b-ic-lora-refine-details-1.0.safetensors' },// Live edit: linoyts' 2-step DMD2 LoRA for Qwen-Image 2.1 (pytorch_lora_weights.safetensors upstream, kept under a@@ -2812,6 +2826,74 @@ export const SPEC = ['No face found: the picture comes back unchanged. Core nodes and the SAM 3.1 checkpoint only.',},+ // ---- Watermark Remover (ComfyUI-Qwen-Watermark @ eef829d3) ----------------+ // Scan, then remove the marks the visitor kept: the app's own page (src/components/watermark) runs both through+ // POST /api/generations. Same Qwen files as Live edit and Inpaint, plus SAM ViT-B for sticker outlines.+ {+ id: 'image-watermark-scan-qwen3vl',+ title: 'Find watermarks, captions, logos, stickers and mosaics on a photo (Qwen3-VL, ComfyUI-Qwen-Watermark)',+ capability: 'watermark-scan',+ handBuilt: 'hand-built/image-watermark-scan-qwen3vl.json',+ packs: ['ComfyUI-Qwen-Watermark'],+ bindings: { image: [b('1', 'image')] },+ outputs: [{ node: '23', kind: 'text', role: 'report' }],+ limits: { maxWidth: 4096, maxHeight: 4096 },+ vramGb: 10,+ license: 'Qwen3-VL 8B Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT',+ notes:+ 'The pack\'s detect-only workflow (qwen_watermark_detection.api.json) without its preview and save nodes: QWMDetect auto_qwen reads the picture once with ' ++ 'Qwen3-VL 8B (int8, detection side 1024, expand 20, padding 0.35, min confidence 0.65) and PreviewAny shows its report, the only output: JSON ' ++ '{coordinate_space: "pixels", image_size, boxes: [{label, bbox (padded repair box), source_bbox (tight), overlay_type, mask_method, confidence}], ' ++ 'rejected_boxes (below 0.65), status}. The app draws source_bbox and sends the kept boxes to image-watermark-remove-qwen21. ' ++ 'The GPU pre-flight also checks image-watermark-remove-qwen21 for a scan (its companion graph).',+ },+ {+ id: 'image-watermark-remove-qwen21',+ title: 'Remove watermarks, captions, logos, stickers and mosaics, the rest unchanged (Qwen-Image 2.1, ComfyUI-Qwen-Watermark)',+ capability: 'watermark-remove',+ handBuilt: 'hand-built/image-watermark-remove-qwen21.json',+ packs: ['ComfyUI-Qwen-Watermark'],+ bindings: {+ image: [b('1', 'image')],+ seed: [b('12', 'seed'), b('30', 'seed')],+ detectMode: [b('3', 'mode')],+ boxes: [b('3', 'boxes_json')],+ maxSize: [b('5', 'max_side'), b('28', 'max_side')],+ },+ outputs: [{ node: '33', kind: 'image' }, { node: '38', kind: 'text', role: 'quality' }],+ limits: { maxWidth: 4096, maxHeight: 4096 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT',+ notes:+ 'The pack\'s main workflow (qwen21_watermark.api.json, plain settings) with the int8 UNET (qwen_image_2.1_int8_convrot, as Live edit) and without its ' ++ 'debug save and preview nodes. QWMDetect (manual_boxes with the kept boxes, auto_qwen for API callers) -> QWMRefineMask (a rectangle for text, logos, ' ++ 'blocks and mosaics, a SAM ViT-B outline for stickers) -> QWMPrepare (context 96, max side maxSize, OpenCV pre-fill) -> Qwen-Image 2.1 edit, 20 steps, ' ++ 'cfg 1 -> QWMComposite (feather 6, align, colour match) -> QWMResidualDetect (Qwen3-VL looks for leftovers inside the first mask) -> one more pass ' ++ 'when it finds some -> QWMFinal keeps the better pass and raises when any pixel outside the mask changed. Outputs: the picture (SaveImage, PNG) and ' ++ 'the quality report (PreviewAny, role quality: folded into the picture\'s meta, never a result of its own). Seeds are random per run. ' ++ 'The structure settings (denoise 0.65 / 0.55, context 384, no pre-fill) are the pack\'s alternative for faces; the GPU test decides between them.',+ },+ {+ id: 'image-watermark-remove-qwen21-brush',+ title: 'Remove what was brushed, the rest unchanged (Qwen-Image 2.1, ComfyUI-Qwen-Watermark)',+ capability: 'watermark-remove',+ handBuilt: 'hand-built/image-watermark-remove-qwen21-brush.json',+ packs: ['ComfyUI-Qwen-Watermark'],+ bindings: {+ image: [b('1', 'image')],+ mask: [b('50', 'image')],+ seed: [b('12', 'seed'), b('30', 'seed')],+ maxSize: [b('5', 'max_side'), b('28', 'max_side')],+ },+ outputs: [{ node: '33', kind: 'image' }, { node: '38', kind: 'text', role: 'quality' }],+ limits: { maxWidth: 4096, maxHeight: 4096 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT',+ notes:+ 'image-watermark-remove-qwen21 with a painted mask: LoadImageMask (red channel, white = remove, the picture\'s size) into QWMDetect manual_mask. ' ++ 'The provider runs it when the request carries a mask, on the latest result.',+ },+// ---- palette / colour lock ----------------------------------------------{id: 'palette-transfer-image',diff --git a/src/app/(studio)/apps/[id]/page.tsx b/src/app/(studio)/apps/[id]/page.tsxindex 8696a30d..93a6d655 100644--- a/src/app/(studio)/apps/[id]/page.tsx+++ b/src/app/(studio)/apps/[id]/page.tsx@@ -6,8 +6,10 @@ import { CleanVoiceTool } from "@/components/audio-tools/clean-voice-tool";import { AnyAngleGate } from "@/components/any-angle/any-angle-tool";import { RelightGate } from "@/components/relight/relight-gate";import { RecolorTool } from "@/components/recolor/recolor-tool";+import { WatermarkTool } from "@/components/watermark/watermark-tool";import { APPS, getModel, getPreset } from "@/lib/catalog";import { withRecipe } from "@/lib/catalog/preset-recipes";+import { presetCover } from "@/lib/preset-covers";import { appStudio } from "@/lib/studios";import { exampleRow } from "@/lib/examples/catalog";import { anyAngleToolLive } from "@/server/any-angle-live";@@ -33,6 +35,8 @@ async function AppStudio({ params }: { params: PageProps<"/apps/[id]">["params"]// have passed their check on a GPU; the owner gets it before then.if (preset.tool === "any-angle") return <AnyAngleGate live={anyAngleToolLive()} app={{ name: preset.name }} />;if (preset.tool === "recolor") return <RecolorTool app={{ name: preset.name, description: preset.description }} />;+ // The Watermark Remover: scan, keep what you like, remove the rest (src/components/watermark).+ if (preset.tool === "watermark") return <WatermarkTool app={{ name: preset.name, description: preset.description }} cover={presetCover(preset.id)} />;// The app opens on the model its preview was made with, its own route one pick away.// Its examples sit in the app's card above the composer: one tap loads the photo and settings each was made with.const studio = <Studio config={withRecipe(appStudio(preset), (m) => !!getModel(m))} examples={exampleRow(`app:${preset.id}`)} />;diff --git a/src/app/globals.css b/src/app/globals.cssindex 7ad9f56a..7efe8b82 100644--- a/src/app/globals.css+++ b/src/app/globals.css@@ -250,6 +250,9 @@--animate-wave-bar: wave-bar 900ms ease-in-out infinite;/* Clean up voice's demo: the "Busy brasserie" dot pulses while the room plays. */--animate-live-dot: live-dot 1.1s ease-out infinite;+ /* Watermark Remover: the scan line moving down the picture, and the line across the marks being removed. */+ --animate-wm-scan: wm-scan 2.2s ease-in-out infinite;+ --animate-wm-sweep: wm-sweep 1.6s ease-in-out infinite;@keyframes shimmer-text {from { mask-position: 100% 0; }@@ -288,6 +291,17 @@from { box-shadow: 0 0 0 0 rgb(255 179 71 / 60%); }to { box-shadow: 0 0 0 8px rgb(255 179 71 / 0%); }}+ @keyframes wm-scan {+ 0% { top: 0%; opacity: 0; }+ 10% { opacity: 1; }+ 90% { opacity: 1; }+ 100% { top: 100%; opacity: 0; }+ }+ @keyframes wm-sweep {+ 0% { top: 0%; }+ 50% { top: calc(100% - 2px); }+ 100% { top: 0%; }+ }}@layer base {diff --git a/src/components/studio/result-actions.tsx b/src/components/studio/result-actions.tsxindex ee2ae172..f54bea3b 100644--- a/src/components/studio/result-actions.tsx+++ b/src/components/studio/result-actions.tsx@@ -24,6 +24,7 @@ import {Lamp,Layers2,Palette,+ ScanLine,LayoutDashboard,Mic2,MicOff,@@ -95,6 +96,7 @@ export const ACTION_ICONS: Record<OutputActionId, LucideIcon> = {"live-edit": Zap,recolor: Palette,upscale: ZoomIn,+ "remove-watermark": ScanLine,reference: ImagePlus,grade: SlidersHorizontal,relight: Lamp,diff --git a/src/components/watermark/flip-compare.tsx b/src/components/watermark/flip-compare.tsxnew file mode 100644index 00000000..9d0b720d--- /dev/null+++ b/src/components/watermark/flip-compare.tsx@@ -0,0 +1,90 @@+"use client";++import { useEffect, useRef, useState } from "react";+import { cn } from "@/lib/utils";++/** How long a press must last to count as a hold (Before while held) rather than a tap (flip). */+export const HOLD_MS = 250;++/**+ * The result in place of the picture: a tap flips between After and Before, a press held over 250 ms shows Before until it+ * lets go. No slider, nothing to drag. Keyboard: Space holds Before, B flips. Before is always the original upload.+ * Keyed by the result where it's used, so a new result starts on After.+ */+export function FlipCompare({ before, after, width, height, children }: { before: string; after: string; width: number; height: number; children?: React.ReactNode }) {+ const [flipped, setFlipped] = useState(false);+ const [holding, setHolding] = useState(false);+ const timer = useRef<ReturnType<typeof setTimeout> | null>(null);+ const held = useRef(false);+ const showBefore = holding || flipped;+ useEffect(() => () => void (timer.current && clearTimeout(timer.current)), []);++ const down = (e: React.PointerEvent) => {+ if (e.button !== 0) return;+ held.current = false;+ timer.current = setTimeout(() => {+ held.current = true;+ setHolding(true);+ }, HOLD_MS);+ };+ const up = () => {+ if (timer.current) clearTimeout(timer.current);+ timer.current = null;+ if (held.current) setHolding(false);+ else setFlipped((f) => !f);+ held.current = false;+ };+ const cancel = () => {+ if (timer.current) clearTimeout(timer.current);+ timer.current = null;+ held.current = false;+ setHolding(false);+ };++ return (+ <div+ role="button"+ tabIndex={0}+ aria-label={showBefore ? "Showing the original. Tap to see the clean picture." : "Showing the clean picture. Tap to see the original."}+ aria-pressed={showBefore}+ data-wm-compare={showBefore ? "before" : "after"}+ className="relative w-full cursor-pointer touch-manipulation overflow-hidden rounded-2xl bg-media outline-none select-none focus-visible:ring-3 focus-visible:ring-ring [-webkit-touch-callout:none]"+ style={{ aspectRatio: `${width} / ${height}` }}+ onPointerDown={down}+ onPointerUp={up}+ onPointerLeave={cancel}+ onPointerCancel={cancel}+ onContextMenu={(e) => e.preventDefault()}+ onKeyDown={(e) => {+ if (e.key === " " && !e.repeat) {+ e.preventDefault();+ setHolding(true);+ } else if (e.key === "b" || e.key === "B" || e.key === "Enter") {+ e.preventDefault();+ setFlipped((f) => !f);+ }+ }}+ onKeyUp={(e) => {+ if (e.key === " ") {+ e.preventDefault();+ setHolding(false);+ }+ }}+ >+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img src={after} alt="The clean picture" draggable={false} className="absolute inset-0 block size-full object-contain" />+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img+ src={before}+ alt="The original picture"+ draggable={false}+ aria-hidden={!showBefore}+ className={cn("absolute inset-0 block size-full object-contain transition-opacity duration-150 motion-reduce:transition-none", showBefore ? "opacity-100" : "opacity-0")}+ />+ <span className="pointer-events-none absolute top-3 left-3 rounded-full bg-[rgb(10_8_6/.6)] px-3 py-1 text-[13px] font-medium text-white backdrop-blur-[10px]" aria-hidden="true">+ {showBefore ? "Before" : "After"}+ </span>+ {children}+ </div>+ );+}diff --git a/src/components/watermark/regions.tsx b/src/components/watermark/regions.tsxnew file mode 100644index 00000000..2467c9ff--- /dev/null+++ b/src/components/watermark/regions.tsx@@ -0,0 +1,119 @@+"use client";++import { Check } from "lucide-react";+import { useRef } from "react";+import { regionAt, type Region } from "@/lib/watermark";+import { cn } from "@/lib/utils";++/** The finger's reach: small marks are hit within this many CSS pixels of their outline. */+const REACH_PX = 22;++const pct = (n: number, of: number) => `${(n / of) * 100}%`;++/**+ * The picture with each mark outlined (its tight box) and named by a chip. A tap keeps a mark (dashed outline, "Kept") or+ * takes it back; where marks overlap, the smallest under the finger wins. Taps only, nothing to drag. The chip row under+ * it gives the same toggles to keyboards and screen readers.+ */+export function RegionsView({+ src,+ width,+ height,+ regions,+ onToggle,+ dim,+ working,+ children,+}: {+ src: string;+ width: number;+ height: number;+ regions: Region[];+ onToggle?: (id: string) => void;+ /** The picture is dimmed (a removal is running). */+ dim?: boolean;+ /** The marks being removed show a moving line. */+ working?: boolean;+ children?: React.ReactNode;+}) {+ const box = useRef<HTMLDivElement>(null);+ const tap = (e: React.MouseEvent) => {+ if (!onToggle || !box.current) return;+ const r = box.current.getBoundingClientRect();+ if (!r.width || !r.height) return;+ const x = ((e.clientX - r.left) / r.width) * width;+ const y = ((e.clientY - r.top) / r.height) * height;+ const hit = regionAt(regions, x, y, (REACH_PX / r.width) * width);+ if (hit) onToggle(hit.id);+ };+ return (+ <div+ ref={box}+ className={cn("relative w-full touch-manipulation overflow-hidden rounded-2xl bg-media select-none", onToggle && "cursor-pointer")}+ style={{ aspectRatio: `${width} / ${height}` }}+ onClick={tap}+ data-wm-regions={regions.length}+ >+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img src={src} alt="Your photo" draggable={false} className={cn("absolute inset-0 block size-full object-contain transition-opacity duration-300", dim && "opacity-55")} />+ {regions.map((g) => {+ const [x0, y0, x1, y1] = g.box;+ const atTop = y0 / height < 0.06;+ return (+ <div+ key={g.id}+ aria-hidden="true"+ data-wm-region={g.id}+ data-on={g.on || undefined}+ className={cn(+ "pointer-events-none absolute rounded-[10px] border-2 transition-colors duration-150",+ g.on ? "border-white bg-white/12 shadow-[0_0_0_1px_rgb(0_0_0/.45),inset_0_0_0_1px_rgb(0_0_0/.25)]" : "border-dashed border-white/70 bg-transparent shadow-[0_0_0_1px_rgb(0_0_0/.25)]",+ working && !g.on && "opacity-0",+ )}+ style={{ left: pct(x0, width), top: pct(y0, height), width: pct(x1 - x0, width), height: pct(y1 - y0, height) }}+ >+ {!working && (+ <span+ className={cn(+ "absolute left-0 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] leading-4 font-semibold whitespace-nowrap shadow-[0_1px_3px_rgb(0_0_0/.35)]",+ atTop ? "top-1 left-1" : "-top-6",+ g.on ? "bg-white text-[#141210]" : "bg-[rgb(10_8_6/.6)] text-white backdrop-blur-[6px]",+ )}+ >+ {g.on ? g.chip : "Kept"}+ </span>+ )}+ {working && g.on && <span className="absolute inset-x-0 top-0 h-[2px] animate-wm-sweep bg-white/90 motion-reduce:animate-pulse" />}+ </div>+ );+ })}+ {children}+ </div>+ );+}++/** Every mark as a toggle under the picture: the same choice as tapping it, for tiny or overlapping marks and screen readers. */+export function RegionChips({ regions, onToggle }: { regions: Region[]; onToggle: (id: string) => void }) {+ return (+ <div className="flex flex-wrap gap-2" role="group" aria-label="Marks found">+ {regions.map((g, i) => (+ <button+ key={g.id}+ type="button"+ aria-pressed={!g.on}+ aria-label={`${g.chip} ${i + 1}: ${g.on ? "will be removed. Tap to keep it." : "kept. Tap to remove it."}`}+ onClick={() => onToggle(g.id)}+ data-wm-chip={g.id}+ className={cn(+ "inline-flex min-h-11 items-center gap-1.5 rounded-full border px-3.5 text-[13px] font-medium transition-colors",+ g.on ? "border-border-strong bg-background text-foreground" : "border-dashed border-border-strong bg-muted text-muted-foreground",+ )}+ >+ {g.on ? <span className="size-2 rounded-full bg-foreground" aria-hidden="true" /> : <Check className="size-3.5" aria-hidden="true" />}+ {g.chip}+ {!g.on && <span className="text-[12px]">· Kept</span>}+ </button>+ ))}+ </div>+ );+}diff --git a/src/components/watermark/watermark-tool.tsx b/src/components/watermark/watermark-tool.tsxnew file mode 100644index 00000000..50e6b479--- /dev/null+++ b/src/components/watermark/watermark-tool.tsx@@ -0,0 +1,642 @@+"use client";++import { Brush, ChevronRight, Download, ImagePlus, Library, Loader2, MoreHorizontal, RotateCcw, ScanLine, Undo2, Upload, Wand2, Zap } from "lucide-react";+import Link from "next/link";+import { nanoid } from "nanoid";+import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";+import { toast } from "sonner";+import { Button } from "@/components/ui/button";+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";+import { ToolShell } from "@/components/av/tool-shell";+import { useGeneration } from "@/components/av/use-generation";+import { fileToSlot, LibraryGrid, type SlotValue } from "@/components/studio/media-slot";+import { TileActions } from "@/components/studio/result-actions";+import { SketchEditor, type SketchResult } from "@/components/studio/sketch-editor";+import { useAskBeforeUpload, useCreateGeneration, useGenerationActions, useHydrated, useViewer } from "@/lib/api";+import type { Generation, OutputFile } from "@/lib/catalog/types";+import { downloadHref } from "@/lib/library";+import type { PresetCover } from "@/lib/preset-covers";+import { toastError } from "@/lib/refusals";+import { cn } from "@/lib/utils";+import {+ COPY,+ foundLine,+ keptBoxesJson,+ MAX_SIDE,+ parseScanReport,+ removeLabel,+ WATERMARK_APP_ID,+ WATERMARK_FEATURE,+ WATERMARK_REMOVE_MODEL,+ WATERMARK_SCAN_FEATURE,+ WATERMARK_SCAN_MODEL,+ type Region,+ type WatermarkQuality,+} from "@/lib/watermark";+import { FlipCompare } from "./flip-compare";+import { RegionChips, RegionsView } from "./regions";++/**+ * The Watermark Remover (app-watermark-remover): add a photo and it is scanned at once; every mark found is outlined with a+ * chip; tap any to keep it; Remove takes the rest off. The result flips with a tap (hold for the original), a brush covers+ * anything missed, and Download gives the PNG as it was made. Phone first, taps only. Both steps are ordinary runs+ * (POST /api/generations) on the person's own GPU; the scan is a helper row the Library hides.+ */++interface Source {+ id: string;+ ref: string;+ preview: string;+ name: string;+ uploading?: boolean;+}++interface Size {+ width: number;+ height: number;+}++const HINT_KEY = "fuobe.watermark.hint";+const busy = (g?: Generation | null) => !!g && (g.status === "queued" || g.status === "running");+const imageOf = (g?: Generation | null): OutputFile | undefined => g?.outputs.find((o) => o.kind === "image");+const reportOf = (g?: Generation | null): string | undefined => g?.outputs.find((o) => o.kind === "text")?.text;+const baseName = (name: string) => name.replace(/\.[a-z0-9]{2,4}$/i, "") || "photo";++/** The picture's own size in pixels, read by the browser (null when it can't be read). */+function readSize(src: string): Promise<Size | null> {+ return new Promise((resolve) => {+ const img = new Image();+ img.onload = () => resolve(img.naturalWidth && img.naturalHeight ? { width: img.naturalWidth, height: img.naturalHeight } : null);+ img.onerror = () => resolve(null);+ img.src = src;+ });+}++function readHint(): boolean {+ try {+ return window.localStorage.getItem(HINT_KEY) === "1";+ } catch {+ return false;+ }+}++function writeHint() {+ try {+ window.localStorage.setItem(HINT_KEY, "1");+ } catch {+ // Private windows and blocked storage: the hint shows again next time.+ }+}++/** ?image= from a Library result's "Remove watermark", the Edit studio or ⌘K, read once after hydration: scanned at once. */+function useHandoff(take: (s: Source) => void) {+ useEffect(() => {+ const url = new URLSearchParams(window.location.search).get("image");+ if (url?.startsWith("/")) take({ id: nanoid(8), ref: url, preview: url, name: decodeURIComponent(url.split("/").pop() ?? "photo") });+ // Once, on arrival.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, []);+}++export function WatermarkTool({ app, cover }: { app: { name: string; description: string }; cover?: PresetCover }) {+ const create = useCreateGeneration();+ const actions = useGenerationActions();+ const askFirst = useAskBeforeUpload();+ const viewer = useViewer().data;+ const [source, setSource] = useState<Source | null>(null);+ const [size, setSize] = useState<Size | null>(null);+ const [tooBig, setTooBig] = useState(false);+ const [scanId, setScanId] = useState<string | null>(null);+ /** The visitor's choices by region id (a mark kept or taken back); the scan's own default otherwise. */+ const [toggles, setToggles] = useState<Record<string, boolean>>({});+ /** Every removal pass, oldest first (each is its own Library item); the newest succeeded one is shown. */+ const [passes, setPasses] = useState<string[]>([]);+ const [brushOpen, setBrushOpen] = useState(false);+ const hydrated = useHydrated();+ const [hintDismissed, setHintDismissed] = useState(false);+ const hintSeen = !hydrated || hintDismissed || readHint();+ /** Why the scan didn't start (a guest, no GPU connected, setup needed): said in words, with Try again. */+ const [scanError, setScanError] = useState<string | null>(null);+ /** How the newest pass was asked: the kept marks (their outlines show while it runs) or a brushed area. */+ const [lastMode, setLastMode] = useState<"boxes" | "brush">("boxes");+ const scan = useGeneration(scanId);+ const lastId = passes.at(-1) ?? null;+ const last = useGeneration(lastId);+ const prevId = passes.at(-2) ?? null;+ const prev = useGeneration(prevId).data;+ const s = scan.data;+ const g = last.data;++ const reset = useCallback(() => {+ setSource(null);+ setSize(null);+ setTooBig(false);+ setScanId(null);+ setToggles({});+ setPasses([]);+ setScanError(null);+ }, []);++ const startScan = useCallback(+ (src: Source) => {+ create.mutate(+ { feature: WATERMARK_SCAN_FEATURE, modelId: WATERMARK_SCAN_MODEL, op: "watermark-scan", inputs: { images: [src.ref] }, title: "Find marks" },+ {+ onSuccess: (items) => setScanId(items[0]?.id ?? null),+ onError: (e) => {+ toastError(e);+ setScanId(null);+ setScanError((e as { gpuSetup?: boolean }).gpuSetup ? "Finish setting up your GPU, then try again." : (e as Error).message || "The scan didn't start. Try again.");+ },+ },+ );+ },+ [create],+ );++ /** A picture to work on: its size is read first (over 4096 px it stops there), then the scan starts by itself. */+ const take = useCallback(+ (src: Source) => {+ setSource(src);+ setScanId(null);+ setToggles({});+ setPasses([]);+ setTooBig(false);+ setScanError(null);+ if (src.uploading) return;+ void readSize(src.preview).then((sz) => {+ setSize(sz);+ if (sz && Math.max(sz.width, sz.height) > MAX_SIDE) return setTooBig(true);+ startScan(src);+ });+ },+ [startScan],+ );++ useHandoff(take);++ // The scan's report as regions, each on or kept as the visitor chose.+ const report = s?.status === "succeeded" ? reportOf(s) : undefined;+ const parsed = useMemo(() => parseScanReport(report), [report]);+ const regions = useMemo(() => parsed?.regions.map((r) => (r.id in toggles ? { ...r, on: toggles[r.id] } : r)) ?? null, [parsed, toggles]);++ const toggle = (id: string) => {+ const r = regions?.find((x) => x.id === id);+ if (r) setToggles((t) => ({ ...t, [id]: !r.on }));+ };+ const onCount = regions?.filter((r) => r.on).length ?? 0;++ // The picture shown: the newest clean result, else the original.+ const okPasses = [g, prev].filter((x): x is Generation => x?.status === "succeeded");+ const latest = imageOf(g?.status === "succeeded" ? g : busy(g) || g?.status === "failed" || g?.status === "canceled" ? prev : undefined);+ const current = latest?.url ?? source?.ref ?? null;+ const shownSize = size ?? (parsed ? { width: parsed.width, height: parsed.height } : null);++ const run = (extra: { boxes?: string; mask?: string }) => {+ if (!source || !current) return;+ setLastMode(extra.mask ? "brush" : "boxes");+ create.mutate(+ {+ feature: WATERMARK_FEATURE,+ presetId: WATERMARK_APP_ID,+ modelId: WATERMARK_REMOVE_MODEL,+ op: "watermark-remove",+ inputs: { images: [current], ...(extra.mask && { mask: extra.mask }) },+ ...(extra.boxes && { params: { extra: { boxes: extra.boxes } } }),+ title: `${COPY.name} · ${baseName(source.name)}`,+ },+ {+ onSuccess: (items) => {+ const id = items[0]?.id;+ if (id) setPasses((p) => [...p, id]);+ },+ onError: (e) => toastError(e),+ },+ );+ };+ const remove = () => {+ if (!regions || onCount === 0) return void toast(COPY.noneKept);+ run({ boxes: keptBoxesJson(regions) });+ };+ const onBrush = (r: SketchResult) => {+ setBrushOpen(false);+ if (!r.mask) return void toast("Brush over the mark first");+ run({ mask: r.mask });+ };+ const undo = () => setPasses((p) => p.slice(0, -1));++ const removing = busy(g) || (create.isPending && !!regions);+ const result = g?.status === "succeeded" ? imageOf(g) : undefined;+ const quality = result?.meta?.quality as WatermarkQuality | undefined;+ const scanFailed = !!scanError || s?.status === "failed" || s?.status === "canceled";+ const empty = !!regions && regions.length === 0 && !passes.length;++ const phase: "start" | "uploading" | "too-big" | "scanning" | "scan-failed" | "empty" | "regions" | "removing" | "result" | "remove-failed" = !source+ ? "start"+ : source.uploading+ ? "uploading"+ : tooBig+ ? "too-big"+ : removing+ ? "removing"+ : result+ ? "result"+ : g?.status === "failed" || g?.status === "canceled"+ ? "remove-failed"+ : scanFailed+ ? "scan-failed"+ : empty+ ? "empty"+ : regions+ ? "regions"+ : "scanning";++ const dismissHint = () => {+ if (hintSeen) return;+ setHintDismissed(true);+ writeHint();+ };++ return (+ <ToolShell+ title="Apps"+ selfHostedOnly+ header={+ <nav aria-label="Breadcrumb" className="hidden items-center gap-1 text-[13px] text-muted-foreground sm:flex">+ <Link href="/apps" className="hover:text-foreground">+ Apps+ </Link>+ <ChevronRight className="size-3.5" />+ <span className="text-foreground">{app.name}</span>+ </nav>+ }+ >+ <div className="mx-auto w-full max-w-[960px] pt-4" data-wm-phase={phase}>+ {phase === "start" && <Start app={app} cover={cover} onPick={take} onUpdate={(next) => setSource((cur) => next(cur))} askFirst={askFirst} />}++ {source && phase !== "start" && (+ <div className="space-y-3">+ <Header phase={phase} found={regions?.length ?? 0} />+ <Picture+ phase={phase}+ source={source}+ src={latest?.url ?? source.preview}+ sweep={lastMode === "boxes" && passes.length <= 1}+ size={shownSize}+ regions={regions ?? []}+ onToggle={phase === "regions" ? toggle : undefined}+ after={result?.url}+ onCompare={dismissHint}+ />+ {phase === "result" && !hintSeen && (+ <p className="text-center text-[13px] text-muted-foreground" role="status">+ {COPY.hint}+ </p>+ )}+ {phase === "regions" && regions && regions.length > 0 && <RegionChips regions={regions} onToggle={toggle} />}+ {phase === "regions" && onCount === 0 && <p className="text-[13px] text-muted-foreground">Tap a mark to remove it</p>}+ {phase === "result" && result && g && (+ <ResultBar g={g} out={result} name={baseName(source.name)} owner={!!viewer?.owner} quality={quality} />+ )}+ {(phase === "scan-failed" || phase === "remove-failed") && (+ <p className="text-[13px] text-destructive" role="alert">+ {phase === "scan-failed" ? (scanError ?? s?.error ?? "The scan didn't finish. Try again.") : (g?.error ?? COPY.rejected)}+ </p>+ )}+ {phase === "too-big" && (+ <p className="text-[13px] text-destructive" role="alert">+ {COPY.tooBig}+ </p>+ )}+ {phase === "empty" && <p className="text-[15px]">{COPY.empty}</p>}+ <Details />+ </div>+ )}+ </div>++ {source && phase !== "start" && (+ <BottomBar>+ {phase === "scanning" || phase === "uploading" ? (+ <>+ <p className="inline-flex min-w-0 flex-1 items-center gap-2 text-[14px]" role="status">+ <Loader2 className="size-4 shrink-0 animate-spin" /> {phase === "uploading" ? "Adding your photo…" : COPY.scanning}+ </p>+ {s && busy(s) && (+ <Button variant="ghost" className="min-h-11 rounded-full" onClick={() => void actions.cancel(s)}>+ Cancel+ </Button>+ )}+ </>+ ) : phase === "regions" ? (+ <>+ <Button variant="outline" className="min-h-11 rounded-full" onClick={() => setBrushOpen(true)}>+ <Brush className="size-4" /> Brush instead+ </Button>+ <Button className="min-h-11 flex-1 rounded-full" onClick={remove} disabled={onCount === 0} data-wm-remove>+ <Wand2 className="size-4" /> {removeLabel(onCount)}+ </Button>+ </>+ ) : phase === "removing" ? (+ <>+ <p className="inline-flex min-w-0 flex-1 items-center gap-2 text-[14px]" role="status">+ <Loader2 className="size-4 shrink-0 animate-spin" /> {COPY.removing}+ </p>+ {g && busy(g) && (+ <Button variant="ghost" className="min-h-11 rounded-full" onClick={() => void actions.cancel(g)}>+ Cancel+ </Button>+ )}+ </>+ ) : phase === "result" && result ? (+ <>+ <Button variant="outline" className="min-h-11 rounded-full" onClick={() => setBrushOpen(true)} data-wm-brush>+ <Brush className="size-4" /> <span className="sm:hidden">Brush a spot</span>+ <span className="hidden sm:inline">Missed a spot? Brush it</span>+ </Button>+ <Button className="min-h-11 flex-1 rounded-full" asChild>+ <a href={downloadHref(result.url, `${baseName(source.name)} · clean.png`)} download={`${baseName(source.name)} · clean.png`} data-wm-download>+ <Download className="size-4" /> Download+ </a>+ </Button>+ </>+ ) : phase === "empty" || phase === "remove-failed" ? (+ <>+ <Button variant="outline" className="min-h-11 rounded-full" onClick={reset}>+ Try another photo+ </Button>+ <Button className="min-h-11 flex-1 rounded-full" onClick={() => setBrushOpen(true)}>+ <Brush className="size-4" /> Brush it+ </Button>+ </>+ ) : phase === "scan-failed" ? (+ <>+ <Button variant="outline" className="min-h-11 rounded-full" onClick={reset}>+ Try another photo+ </Button>+ <Button className="min-h-11 flex-1 rounded-full" onClick={() => source && take({ ...source })}>+ <RotateCcw className="size-4" /> Try again+ </Button>+ </>+ ) : (+ <Button className="min-h-11 flex-1 rounded-full" onClick={reset}>+ <ImagePlus className="size-4" /> Try another photo+ </Button>+ )}+ </BottomBar>+ )}++ {source && phase !== "start" && (+ <div className="mx-auto mt-3 flex w-full max-w-[960px] flex-wrap items-center gap-2">+ {phase === "result" && okPasses.length > 1 && (+ <Button variant="ghost" size="sm" className="min-h-11 rounded-full" onClick={undo}>+ <Undo2 className="size-4" /> Undo+ </Button>+ )}+ {phase !== "scanning" && phase !== "removing" && phase !== "uploading" && (+ <Button variant="ghost" size="sm" className="min-h-11 rounded-full" onClick={reset} data-wm-start-over>+ <RotateCcw className="size-4" /> Start over+ </Button>+ )}+ </div>+ )}++ {brushOpen && current && <SketchEditor open onOpenChange={setBrushOpen} image={latest?.url ?? source?.preview ?? current} mode="mask" onDone={onBrush} />}+ </ToolShell>+ );+}++function Header({ phase, found }: { phase: string; found: number }) {+ const line =+ phase === "regions" ? foundLine(found) : phase === "result" ? "Done. Tap the picture to compare." : phase === "removing" ? COPY.removing : phase === "scanning" ? COPY.scanning : null;+ if (!line) return null;+ return (+ <h2 className="font-heading text-[22px] leading-tight text-balance sm:text-[26px]" aria-live="polite">+ {line}+ </h2>+ );+}++function Picture({+ phase,+ source,+ src,+ sweep,+ size,+ regions,+ onToggle,+ after,+ onCompare,+}: {+ phase: string;+ source: Source;+ /** What is shown while working on it: the newest clean result, else the original. */+ src: string;+ /** The kept marks' outlines show while the removal runs (not for a brushed pass). */+ sweep: boolean;+ size: Size | null;+ regions: Region[];+ onToggle?: (id: string) => void;+ after?: string;+ onCompare: () => void;+}) {+ // Tall pictures stay on one screen: the width follows the height left for them.+ const ratio = size ? size.width / size.height : 4 / 3;+ const style = { maxWidth: `min(100%, calc((100svh - 260px) * ${ratio.toFixed(4)}))` };+ if (phase === "result" && after && size) {+ return (+ <div className="mx-auto" style={style} onPointerDown={onCompare}>+ <FlipCompare key={after} before={source.preview} after={after} width={size.width} height={size.height} />+ </div>+ );+ }+ if (!size) {+ return (+ <div className="mx-auto grid aspect-[4/3] w-full place-items-center rounded-2xl bg-media" style={style}>+ <Loader2 className="size-5 animate-spin text-white/70" />+ </div>+ );+ }+ const scanning = phase === "scanning";+ return (+ <div className="mx-auto" style={style}>+ <RegionsView src={src} width={size.width} height={size.height} regions={phase === "regions" || (phase === "removing" && sweep) ? regions : []} onToggle={onToggle} dim={phase === "removing"} working={phase === "removing"}>+ {scanning && (+ <>+ <span aria-hidden="true" className="pointer-events-none absolute inset-x-0 h-[3px] animate-wm-scan bg-gradient-to-r from-transparent via-white to-transparent shadow-[0_0_18px_4px_rgb(255_255_255/.55)] motion-reduce:hidden" />+ <span aria-hidden="true" className="pointer-events-none absolute inset-0 hidden animate-pulse bg-white/10 motion-reduce:block" />+ </>+ )}+ </RegionsView>+ </div>+ );+}++function ResultBar({ g, out, name, owner, quality }: { g: Generation; out: OutputFile; name: string; owner: boolean; quality?: WatermarkQuality }) {+ const q = encodeURIComponent(out.url);+ const [more, setMore] = useState(false);+ return (+ <div className="space-y-2">+ <div className="flex flex-wrap items-center gap-2">+ <Button variant="outline" size="sm" className="min-h-11 rounded-full" asChild>+ <Link href={`/edit?image=${q}`}>+ <Wand2 className="size-4" /> Edit+ </Link>+ </Button>+ <Button variant="outline" size="sm" className="min-h-11 rounded-full" asChild>+ <Link href={`/live-edit?image=${q}&gen=${encodeURIComponent(g.id)}&from=library`}>+ <Zap className="size-4" /> Live edit+ </Link>+ </Button>+ {/* The standard menu mounts on the first tap (it opens as it mounts), like a Library tile's. */}+ {more ? (+ <TileActions g={g} index={Math.max(0, g.outputs.indexOf(out))} menuOnly tone="surface" triggerClassName="inline-flex size-11 items-center justify-center rounded-full border bg-background" />+ ) : (+ <Button variant="outline" size="icon" className="size-11 rounded-full" aria-label="More actions" onClick={() => setMore(true)}>+ <MoreHorizontal className="size-4" />+ </Button>+ )}+ <span className="sr-only">{name}</span>+ </div>+ {/* The repair's own verdict, for the owner only: visitors and accounts never see it. */}+ {owner && quality && (quality.needsReview || quality.status !== "completed_clean_first_pass") && (+ <p className="text-[12px] text-muted-foreground" data-wm-owner-status>+ Owner: {quality.status}+ {quality.selectedPass !== undefined ? ` · pass ${quality.selectedPass}` : ""}+ {quality.reasons?.length ? ` · ${quality.reasons.join(", ")}` : ""}+ </p>+ )}+ </div>+ );+}++function Details() {+ return (+ <ul className="space-y-1 pt-2 text-[12px] text-muted-foreground">+ {COPY.details.map((d) => (+ <li key={d}>{d}</li>+ ))}+ </ul>+ );+}++function BottomBar({ children }: { children: React.ReactNode }) {+ return (+ <div className="sticky bottom-0 z-10 -mx-3 mt-4 border-t bg-background/92 px-3 pt-3 pb-[max(12px,env(safe-area-inset-bottom))] backdrop-blur sm:-mx-6 sm:px-6">+ <div className="mx-auto flex w-full max-w-[960px] items-center gap-2">{children}</div>+ </div>+ );+}++/** Nothing added yet: the demo, then "Add a photo" and "From Library". */+function Start({+ app,+ cover,+ onPick,+ onUpdate,+ askFirst,+}: {+ app: { name: string; description: string };+ /** The app's cover (its before and after), handed over by the server page: the demo. */+ cover?: PresetCover;+ onPick: (s: Source) => void;+ onUpdate: (next: (cur: Source | null) => Source | null) => void;+ askFirst: () => boolean;+}) {+ const inputId = useId();+ const [over, setOver] = useState(false);+ const [picking, setPicking] = useState(false);+ const pending = useRef<string | null>(null);+ const upload = (f: File | undefined) => {+ if (!f || askFirst()) return;+ if (!f.type.startsWith("image/")) return void toast("Add a photo: JPG, PNG or WebP");+ const id = nanoid(8);+ pending.current = id;+ void fileToSlot(+ f,+ (v) => {+ if (!v) return onUpdate((cur) => (cur?.id === id ? null : cur));+ const src: Source = { id, ref: v.ref, preview: v.preview, name: f.name, uploading: v.uploading };+ if (v.uploading) onPick(src);+ else if (pending.current === id) onPick(src);+ },+ "image",+ );+ };+ const fromLibrary = (v: SlotValue) => {+ setPicking(false);+ onPick({ id: nanoid(8), ref: v.ref, preview: v.preview, name: v.name ?? "photo" });+ };+ return (+ <div className="space-y-5">+ <div className="text-center">+ <h2 className="font-heading text-display text-balance">{COPY.hero}</h2>+ <p className="mx-auto mt-2 max-w-xl text-[14px] text-pretty text-muted-foreground">{COPY.subline}</p>+ </div>+ {cover?.video ? (+ <video+ src={cover.video}+ poster={cover.poster}+ muted+ loop+ autoPlay+ playsInline+ preload="metadata"+ aria-label={`${app.name}: a photo before and after`}+ className="mx-auto block aspect-[4/3] w-full max-w-[760px] rounded-2xl bg-media object-cover"+ />+ ) : cover ? (+ // eslint-disable-next-line @next/next/no-img-element+ <img src={cover.poster} alt={`${app.name}: a photo before and after`} className="mx-auto block aspect-[4/3] w-full max-w-[760px] rounded-2xl bg-media object-cover" />+ ) : null}+ <div+ className={cn(+ "mx-auto flex max-w-[760px] flex-col items-center justify-center gap-3 rounded-2xl border-2 border-dashed border-border-strong bg-background px-4 py-8 text-center transition-colors",+ over && "border-primary bg-brand-faint",+ )}+ onDragOver={(e) => {+ e.preventDefault();+ setOver(true);+ }}+ onDragLeave={() => setOver(false)}+ onDrop={(e) => {+ e.preventDefault();+ setOver(false);+ upload(e.dataTransfer.files?.[0]);+ }}+ >+ <span className="grid size-12 place-items-center rounded-2xl bg-brand-faint text-brand-text">+ <ScanLine className="size-5" />+ </span>+ <p className="text-[13px] text-muted-foreground">{app.description}.</p>+ <div className="flex w-full flex-col items-stretch gap-2 sm:w-auto sm:flex-row sm:items-center">+ <Button className="min-h-11 rounded-full" onClick={() => askFirst() || document.getElementById(inputId)?.click()} data-wm-add>+ <Upload className="size-4" /> Add a photo+ </Button>+ <Popover open={picking} onOpenChange={setPicking}>+ <PopoverTrigger asChild>+ <Button variant="outline" className="min-h-11 rounded-full" onClick={(e) => askFirst() && e.preventDefault()}>+ <Library className="size-4" /> From Library+ </Button>+ </PopoverTrigger>+ <PopoverContent className="w-[min(92vw,360px)] p-2" collisionPadding={12}>+ <p className="px-1 pb-2 text-[13px] font-medium">From your library</p>+ {picking && <LibraryGrid kinds={["image"]} onPick={fromLibrary} />}+ </PopoverContent>+ </Popover>+ </div>+ <input+ id={inputId}+ type="file"+ accept="image/png,image/jpeg,image/webp"+ hidden+ data-wm-file+ onChange={(e) => {+ upload(e.target.files?.[0]);+ e.target.value = "";+ }}+ />+ </div>+ <Details />+ </div>+ );+}diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.tsindex 2bfb09fd..8de4ba97 100644--- a/src/lib/catalog/apps.ts+++ b/src/lib/catalog/apps.ts@@ -1905,6 +1905,24 @@ export const APPS: Preset[] = [open: { modelId: "oss-reuse-voice", op: "enhance-voice" },parity: "Runs on open-source models only, on your GPU or CPU. RE-USE isn't hosted on fal or Replicate.",}),+ // Watermark Remover (ComfyUI-Qwen-Watermark): an app with a page of its own (src/components/watermark): scan, keep what you+ // like, remove the rest; a brush for anything missed. Both steps run on your GPU through POST /api/generations.+ app({+ id: "app-watermark-remover",+ name: "Watermark Remover",+ category: "Utility",+ description: "Clears text, logos, stickers and mosaics off a photo. The rest stays exactly as it was",+ icon: "ScanLine",+ hue: 205,+ badges: ["new"],+ tool: "watermark",+ inputs: [{ key: "image", label: "Photo", hint: "A photo up to 4096 pixels on its longest side", accept: "image", required: true }],+ userPrompt: "none",+ prompt: "Remove the watermark",+ cloud: null,+ open: { modelId: "oss-watermark-remover", op: "watermark-remove" },+ parity: "Runs on your own GPU. What was hidden under a mark is re-imagined from what's around it; everything outside the marks stays pixel for pixel the same.",+ }),app({name: "Object Remover",category: "Utility",diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.tsindex 1409f5ae..6f6210ca 100644--- a/src/lib/catalog/models.ts+++ b/src/lib/catalog/models.ts@@ -2893,6 +2893,35 @@ const faceMosaic: ModelDef = o({hidden: true,});+/**+ * The Watermark Remover app's two steps on the GPU (ComfyUI-Qwen-Watermark): Qwen3-VL finds the marks printed over a photo,+ * then Qwen-Image 2.1 repairs only under the ones kept (or a brushed area). Hidden: the app's own page runs them.+ */+const watermark: ModelDef[] = [+ o({+ id: "oss-watermark-scan",+ name: "Find watermarks",+ vendor: "Qwen3-VL + ComfyUI",+ family: "qwen",+ kind: "text",+ tagline: "Finds text, logos, stickers, mosaics and blocks printed over a photo, with their boxes",+ routes: [{ ...comfy("watermark-scan", "image-watermark-scan-qwen3vl", "Qwen3-VL 8B int8, one pass, boxes in pixels"), unsized: true, maxImages: 1 }],+ options: { maxImages: 1, promptOptional: true },+ hidden: true,+ }),+ o({+ id: "oss-watermark-remover",+ name: "Watermark Remover",+ vendor: "Qwen-Image 2.1 + ComfyUI",+ family: "qwen",+ kind: "image",+ tagline: "Repairs only under the marks kept for removal; every other pixel stays as it was",+ routes: [{ ...comfy("watermark-remove", "image-watermark-remove-qwen21", "Qwen-Image 2.1 int8 repair, a leftover check, a second pass when needed"), unsized: true, maxImages: 1 }],+ options: { maxImages: 1, promptOptional: true, seed: true },+ hidden: true,+ }),+];+/** Tools that run entirely in the browser; recorded in the library like any other result. */const local: ModelDef[] = [{@@ -3001,4 +3030,4 @@ const local: ModelDef[] = [}),];-export const MODELS: ModelDef[] = [...originals, ...cloud, ...open, faceMosaic, ...local];+export const MODELS: ModelDef[] = [...originals, ...cloud, ...open, faceMosaic, ...watermark, ...local];diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.tsindex c9c85401..2280ea1c 100644--- a/src/lib/catalog/plan.ts+++ b/src/lib/catalog/plan.ts@@ -24,6 +24,7 @@ import { carriesLayout, flux3Boxes, flux3Caption, layoutCompilerFor, LAYOUT_MAX_import { pricingOn, type PriceClock } from "./promo";import { isInstrumental, lyricsOf, lyricsProblem, LYRICS_PARAM, promptLyricsProblem } from "@/lib/lyrics";import { presetRoutes } from "./preset-recipe-routes";+import { checkWatermarkBoxes } from "@/lib/watermark";export { pricingAt } from "./promo";@@ -254,6 +255,8 @@ const PROMPTLESS = new Set<Operation>(["song-extend", "song-stems",// An inserted moment can be left to the model; a retexture takes words or a style picture"insert-moment", "retexture-3d",+ // Watermark Remover: the marks are found, kept or brushed; no words+ "watermark-scan", "watermark-remove",]);/**@@ -588,6 +591,13 @@ export function planGeneration(const missing = missingInputs(op, req) ?? unreadInputs(model, op, req) ?? missingImages(model, req);if (missing) throw new Error(missing);+ // Watermark Remover: the kept marks are checked and rebuilt here (never passed on as sent); a brushed run takes none.+ if (op === "watermark-remove" && params.extra && "boxes" in params.extra) {+ const extra = { ...params.extra };+ if (req.inputs?.mask) delete extra.boxes;+ else extra.boxes = checkWatermarkBoxes(extra.boxes).json;+ params = { ...params, extra };+ }const tooMany = extraImages(model, op, req);if (tooMany) throw new Error(tooMany);@@ -844,6 +854,8 @@ const NEEDS: Partial<keyframes: { images: 1, msg: "Add the keyframes, in order" },"sdr-to-hdr": { video: true, msg: "Add the video to convert" },"face-mosaic": { images: 1, msg: "Add the picture whose faces to pixelate" },+ "watermark-scan": { images: 1, msg: "Add the picture to check" },+ "watermark-remove": { images: 1, msg: "Add the picture to clean" },"restore-video": { video: true, msg: "Add the archive clip to restore" },"song-extend": { audio: true, msg: "Add the song to extend" },"song-remix": { audio: true, msg: "Add the song to remix" },diff --git a/src/lib/catalog/preset-recipe-routes.ts b/src/lib/catalog/preset-recipe-routes.tsindex dc8d1d8b..33042d50 100644--- a/src/lib/catalog/preset-recipe-routes.ts+++ b/src/lib/catalog/preset-recipe-routes.ts@@ -54,6 +54,7 @@ export type RecipeKind = "h3" | "orbit" | "qwen";* - Head Swap: the whole head, hair included, comes from its own head LoRA; a plain edit keeps the first hair.* - Outfit Swap: its Outfit Swap LoRA keeps everything but the clothes in place, where a plain edit moves the picture.* - Photo to 3D: only its own graph makes the GLB, the splat and the orbit clip together.+ * - Watermark Remover: a tool of its own (scan, keep, remove) that changes nothing outside the marks.*/export const OWN_ROUTE_APPS: ReadonlySet<string> = new Set(["app-fuobe-angles",@@ -77,6 +78,7 @@ export const OWN_ROUTE_APPS: ReadonlySet<string> = new Set(["app-head-swap","app-outfit-swap","app-photo-to-3d",+ "app-watermark-remover",]);/**diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex 872f8bf6..ed57ee6f 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -89,6 +89,9 @@ export type Operation =// N7-5| "composite" // footage + its redrawn swap + the swap + the person's mask → only the person over the footage (Character swap in 2K)| "camera-path" // image + params.cameraPath (+ inputs.video: the open engine's render along the path) → the camera following the path+ // Watermark Remover+ | "watermark-scan" // image → a JSON report of the marks printed over it (text, logos, stickers, mosaics, blocks) with their boxes in pixels+ | "watermark-remove" // image + params.extra.boxes (the marks kept for removal) or a mask (white = remove) → the same picture, only under them repaired// archive-restore| "restore-video" // archive video (+ prompt: period, place, light; negative: what not to invent) → the same shot clean, in colour, larger// Design a voice@@ -181,6 +184,8 @@ export const OPERATION_LABELS: Record<Operation, string> = {"face-mosaic": "Pixelate faces","camera-path": "Fly path",composite: "Character over the footage",+ "watermark-scan": "Find marks",+ "watermark-remove": "Remove watermark","restore-video": "Restore & colourise","face-fix-video": "Fix faces","tone-video": "Fix colours",@@ -269,6 +274,8 @@ export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {"face-mosaic": "image","camera-path": "video",composite: "video",+ "watermark-scan": "text",+ "watermark-remove": "image","restore-video": "video","face-fix-video": "video","tone-video": "video",@@ -1533,8 +1540,8 @@ export interface Preset {grade?: string;/** Fuobe DoP's relight effects: a step that makes the start frame first, on each engine (src/lib/catalog/dop.ts). */prestep?: PresetPrestep;- /** An app that is a tool of its own: its page renders that tool rather than the composer (Clean up voice, Relight, Any Angle, Tap to Recolor). */- tool?: "clean-voice" | "relight" | "any-angle" | "recolor";+ /** An app that is a tool of its own: its page renders that tool rather than the composer (Clean up voice, Relight, Any Angle, Tap to Recolor, Watermark Remover). */+ tool?: "clean-voice" | "relight" | "any-angle" | "recolor" | "watermark";/** The recipe its preview was made with (src/lib/catalog/preset-recipe-book.json): the route it opens on follows it. */recipe?: PresetRecipeBook;}diff --git a/src/lib/comfy-variants.ts b/src/lib/comfy-variants.tsindex 13cd212e..0e97a578 100644--- a/src/lib/comfy-variants.ts+++ b/src/lib/comfy-variants.ts@@ -53,6 +53,14 @@ export const YUE2_COVER_GRAPH: Record<string, string> = { "music-yue2-song": "mu* describer.*/export const OUTFIT_WORDS_GRAPH: Record<string, string> = { "outfit-swap-qwen-image-21": "outfit-swap-qwen-image-21-text" };+/** The Watermark Remover with a brushed area (inputs.mask, white = remove): the graph that reads the mask instead of boxes. */+export const WATERMARK_BRUSH_GRAPH: Record<string, string> = { "image-watermark-remove-qwen21": "image-watermark-remove-qwen21-brush" };++/**+ * Graphs the GPU pre-flight checks along with the one that runs: a step whose next step is sure to follow (the Watermark+ * Remover's scan, then its removal), so one setup plan covers the whole flow and nobody is stopped after the first step.+ */+export const COMPANION_GRAPHS: Record<string, string[]> = { "image-watermark-scan-qwen3vl": ["image-watermark-remove-qwen21"] };export interface VariantRequest {op: string;@@ -65,6 +73,8 @@ export interface VariantRequest {audio2: boolean;/** An audio input is given (a song to cover). */audio?: boolean;+ /** A painted mask is given (the Watermark Remover's brush). */+ mask?: boolean;extra: Record<string, unknown>;/** Is this workflow in the library. */has: (id: string) => boolean;@@ -106,5 +116,7 @@ export function resolveWorkflowId(endpointTemplate: string, r: VariantRequest):if (words && r.images < 2 && r.has(words)) endpoint = words;const bed = REUSE_BED_GRAPH[endpoint];if (bed && r.extra.background === "keep" && r.has(bed)) endpoint = bed;+ const brush = WATERMARK_BRUSH_GRAPH[endpoint];+ if (brush && r.mask && r.has(brush)) endpoint = brush;return endpoint;}diff --git a/src/lib/comfy.ts b/src/lib/comfy.tsindex 88fd4147..91ee2e61 100644--- a/src/lib/comfy.ts+++ b/src/lib/comfy.ts@@ -96,7 +96,9 @@ export interface ManifestOutput {// Any Angle: the turntable at 192 px (colour, and its coverage) the front view is measured on, and a GLB made from a splat.| "sweep"| "sweep-mask"- | "mesh";+ | "mesh"+ // Watermark Remover: the repair's verdict (QWMFinal), folded into the picture outputs' meta.+ | "quality";}export interface ManifestWorkflow {diff --git a/src/lib/command-search.ts b/src/lib/command-search.tsindex 2eaca37e..ee83b3f4 100644--- a/src/lib/command-search.ts+++ b/src/lib/command-search.ts@@ -160,6 +160,7 @@ export function rankPalette(entries: PaletteEntry[], query: string, limits: Reco/** Words people type for an app that its name doesn't say. */export const APP_KEYWORDS: Record<string, string> = {+ "app-watermark-remover": "watermark remove watermark logo text caption overlay stamp sticker mosaic blur block clean photo erase logo remove text","app-clean-up-voice": "clean up voice denoise noise removal remove echo reverb enhance speech podcast audio fix mic phone audio restore audio",};diff --git a/src/lib/gpu/commands.ts b/src/lib/gpu/commands.tsindex 83af89fe..1a9f5de2 100644--- a/src/lib/gpu/commands.ts+++ b/src/lib/gpu/commands.ts@@ -125,7 +125,9 @@ function packLines(shell: Shell, l: Layout, name: string, p: IndexPack, kind: Stconst dest = l.under(shell, "custom_nodes", name);const py = l.python(shell);const req = l.under(shell, "custom_nodes", name, "requirements.txt");- const pip = p.requirementsTxt ? [`${py} -m pip install -r ${req}`] : [];+ // A pack's own requirements.txt, or the pinned packages packs.json names instead (only "name==version" ones are written).+ const named = (p.pip ?? []).filter((s) => /^[A-Za-z0-9][A-Za-z0-9._-]*==[0-9][0-9A-Za-z.+-]*$/.test(s));+ const pip = p.requirementsTxt ? [`${py} -m pip install -r ${req}`] : named.length ? [`${py} -m pip install ${named.join(" ")}`] : [];if (kind === "pack-repair") return [comment(shell, `${name} didn't start. Reinstall its Python packages, then restart ComfyUI`), ...pip];if (p.file) {// One node file in a model repo: fetched at the commit, as the package's __init__.py.diff --git a/src/lib/gpu/types.ts b/src/lib/gpu/types.tsindex 05cfb949..ad009617 100644--- a/src/lib/gpu/types.ts+++ b/src/lib/gpu/types.ts@@ -52,6 +52,8 @@ export interface IndexPack {*/file?: string;requirementsTxt: boolean;+ /** Python packages installed by name, pinned (`segment-anything==1.0`), when its requirements.txt isn't safe to install. */+ pip?: string[];install: "registry" | "manual";}diff --git a/src/lib/library.ts b/src/lib/library.tsindex 03e728e2..6a9ddbfd 100644--- a/src/lib/library.ts+++ b/src/lib/library.ts@@ -135,13 +135,13 @@ export function listOrder(f: Pick<FeedFilter, "trashed" | "pinned">): (a: Genera* Jobs nobody asked to see on their own: the steps a chain runs before its result (a Shorts cut, a* Click to Ad voiceover, an Ad Multiplier hook: every "<studio>-step" feature), and helper jobs a* studio starts by itself (a Mixed Media preview frame, a Faceless channel avatar or narrator sample,- * a moodboard's cover), the evaluation harness's runs (scripts/eval: hundreds of test renders) and a skill+ * a moodboard's cover, the Watermark Remover's scans), the evaluation harness's runs (scripts/eval: hundreds of test renders) and a skill* recipe's free dry runs (skill-check, moved to the Trash when the check ends). The* Library and the home feed leave them out unless "Show steps" is on; a list that names its features* (a studio reading its own steps) gets what it asks for.*/export const HELPER_SUFFIX = "-step";-export const HELPER_FEATURES = ["mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard", "eval", "skill-check"] as const;+export const HELPER_FEATURES = ["mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard", "eval", "skill-check", "watermark-scan"] as const;export function isHelperFeature(feature: string): boolean {return feature.endsWith(HELPER_SUFFIX) || (HELPER_FEATURES as readonly string[]).includes(feature);diff --git a/src/lib/licences.ts b/src/lib/licences.tsindex f0785c65..b7e1d523 100644--- a/src/lib/licences.ts+++ b/src/lib/licences.ts@@ -475,6 +475,13 @@ export const NODE_PACKS: NodePack[] = [url: SPDX("Apache-2.0"),note: "VoxCPM2 text to speech (voice design) and voice clone nodes; Apache-2.0 code. The VoxCPM2 weights it downloads are Apache-2.0",}),+ // Watermark Remover (image-watermark-*): overflowofedge's Qwen watermark nodes, pinned in install-comfyui.sh.+ pack("ComfyUI-Qwen-Watermark", "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34", {+ name: "MIT",+ class: "commercial",+ url: SPDX("MIT"),+ note: "The Watermark Remover's nodes: find the marks (Qwen3-VL 8B, Apache-2.0), outline stickers (SAM ViT-B, Apache-2.0), repair and check the result; MIT code. The Qwen-Image 2.1 weights the repair runs are non-commercial",+ }),// Genjutsu's Character swap (docs/research/openjutsu-6.md §7): Akatz Labs' packs, pinned in install-comfyui.sh.pack("h3_character_swap", "https://github.com/akatz-labs/h3-character-swap-tool/tree/0670e4fdf95adf2262caa4b81afed2a9c4ae4b7b/worker_nodes/h3_character_swap", {...GPL,diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.tsindex 9ccce972..6664fc2b 100644--- a/src/lib/output-actions.ts+++ b/src/lib/output-actions.ts@@ -17,6 +17,7 @@ import { CLEAN_FEATURE } from "./av/clean-voice";import { anyAngleHref } from "./catalog/any-angle";import { isInstrumental, lyricsOf, songFormat, STEMS_FORMATS } from "./lyrics";import { CLEAN_DIALOGUE_FEATURE, cleanDialogueHref } from "./av/clean-dialogue";+import { WATERMARK_APP_ID, WATERMARK_FEATURE } from "./watermark";export type OutputActionId =| "animate"@@ -46,6 +47,7 @@ export type OutputActionId =| "remove-person"| "clean-voice"| "clean-dialogue"+ | "remove-watermark"| "copy-text"| "view-3d"| "remix-kinetic"@@ -154,6 +156,8 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =link("upscale", "Upscale", `/upscale?image=${q(o.url)}`);// Any Angle: the same photo from another camera (its 3D view is built once per photo).link("new-angle", "New angle", anyAngleHref(o.url));+ // The Watermark Remover's own results go back through its brush instead.+ if (g.feature !== WATERMARK_FEATURE) link("remove-watermark", "Remove watermark", `/apps/${WATERMARK_APP_ID}?image=${q(o.url)}`);link("reference", "Use as reference", `/image?ref=${q(o.url)}`);link("grade", "Color grade", `/color-grade?image=${q(o.url)}`);link("layers", "Open in Layers", layersHref(g, o.url));diff --git a/src/lib/preset-featured.ts b/src/lib/preset-featured.tsindex 4b66f1e7..d1bafdc1 100644--- a/src/lib/preset-featured.ts+++ b/src/lib/preset-featured.ts@@ -12,7 +12,7 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {app-behind-the-scenes app-relight app-macroshot-product app-color-grading app-age-shift app-makeup-studioapp-angles app-shots app-match-lighting app-match-colors app-product-shot app-bullet-time-sceneapp-bullet-time-splash app-chameleon app-outfit-swap app-tap-to-recolor app-steal-the-look app-outfit-shot app-sketch-to-real- app-video-face-swap app-video-background-remover app-clean-up-voice app-breakdown+ app-video-face-swap app-video-background-remover app-watermark-remover app-clean-up-voice app-breakdown`,`app-hairstyle-try-on app-fuobe-angles app-any-angle app-product-placement app-link-to-video-ad app-style-snap app-steam-it app-urban-cutsdiff --git a/src/lib/studios.ts b/src/lib/studios.tsindex 75de6b88..bb07900c 100644--- a/src/lib/studios.ts+++ b/src/lib/studios.ts@@ -56,6 +56,7 @@ export const EDIT_STUDIO: StudioConfig = {multiRef: { label: "Add ref", max: 9 },sketch: ["mask", "draw"],live: true,+ related: { href: "/apps/app-watermark-remover", label: "Remove watermarks, captions and logos automatically" },defaultModels: { cloud: "nano-banana-pro", open: "oss-qwen-image-21" },suggestions: ["Make it golden hour",diff --git a/src/lib/watermark.ts b/src/lib/watermark.tsnew file mode 100644index 00000000..bb7ff22a--- /dev/null+++ b/src/lib/watermark.ts@@ -0,0 +1,246 @@+/**+ * Watermark Remover (app-watermark-remover): the pure parts both sides share. The scan's report (ComfyUI-Qwen-Watermark's+ * QWMDetect JSON) read into regions the page draws, the chips they wear, the kept marks checked and rebuilt before they+ * reach the graph, the size the repair works at, and the quality verdict kept on the result.+ */++export const WATERMARK_APP_ID = "app-watermark-remover";+/** The removal's feature (a Library item); the scan is a helper the Library hides (HELPER_FEATURES). */+export const WATERMARK_FEATURE = `app:${WATERMARK_APP_ID}`;+export const WATERMARK_SCAN_FEATURE = "watermark-scan";+export const WATERMARK_SCAN_MODEL = "oss-watermark-scan";+export const WATERMARK_REMOVE_MODEL = "oss-watermark-remover";++/** The pack's mark types (processing.py OVERLAY_TYPES). */+export const OVERLAY_TYPES = ["text_logo", "translucent_text_logo", "rectangle", "mosaic", "irregular_sticker", "unknown"] as const;+export type OverlayType = (typeof OVERLAY_TYPES)[number];++/** What a region's chip says. */+export type Chip = "Text" | "Logo" | "Mosaic" | "Sticker" | "Block" | "Mark";++/** At most this many marks in one removal. */+export const MAX_BOXES = 32;+/** Labels are cut to this many characters. */+export const MAX_LABEL = 80;+/** The longest side a picture may have. */+export const MAX_SIDE = 4096;+/** Marks the scan was less sure of are shown off (kept) at first. */+export const SURE = 0.65;++/** Visitor words. */+export const COPY = {+ name: "Watermark Remover",+ tagline: "Clears text, logos, stickers and mosaics off a photo. The rest stays exactly as it was.",+ hero: "Clean up a photo",+ subline: "We find what's printed over your picture. Keep anything you like, remove the rest.",+ details: [+ "What was hidden under a mark is re-imagined from what's around it, so it may not match the original exactly.",+ "Everything outside the marks stays pixel for pixel the same.",+ "Use it on pictures you own or have the rights to.",+ "Runs on your own GPU.",+ ],+ scanning: "Looking for marks…",+ removing: "Removing…",+ empty: "Nothing to remove found. Brush the area you want gone.",+ rejected: "We couldn't remove that cleanly. Brush just the mark and try again.",+ tooBig: "Use a picture up to 4096 pixels on its longest side.",+ noneKept: "Pick at least one mark to remove",+ hint: "Tap to compare. Hold to see the original.",+} as const;++const TEXT_WORDS = /text|caption|word|letter|url|www|@|©|date|signature/i;++export function normalizeType(value: unknown): OverlayType {+ const t = String(value ?? "").trim().toLowerCase();+ return (OVERLAY_TYPES as readonly string[]).includes(t) ? (t as OverlayType) : "unknown";+}++/** The chip a mark wears: Text or Logo for printed marks (by the words the scan used), else its kind. */+export function chipFor(type: OverlayType, label = ""): Chip {+ if (type === "text_logo" || type === "translucent_text_logo") return TEXT_WORDS.test(label) ? "Text" : "Logo";+ if (type === "mosaic") return "Mosaic";+ if (type === "irregular_sticker") return "Sticker";+ if (type === "rectangle") return "Block";+ return "Mark";+}++export type Box = [x0: number, y0: number, x1: number, y1: number];++export interface Region {+ id: string;+ type: OverlayType;+ label: string;+ chip: Chip;+ /** The tight box around the mark, in the picture's pixels: what the page outlines. */+ box: Box;+ /** The padded box the repair works in, in pixels. */+ repair: Box;+ /** On at first (the scan was sure of it); a less sure mark starts kept. */+ on: boolean;+}++export interface ScanResult {+ width: number;+ height: number;+ regions: Region[];+}++const finite = (v: unknown): v is number => typeof v === "number" && Number.isFinite(v);+const box4 = (v: unknown): Box | null => (Array.isArray(v) && v.length === 4 && v.every(finite) ? (v as Box) : null);++function ordered(b: Box, width: number, height: number): Box | null {+ const x0 = Math.max(0, Math.min(width, Math.min(b[0], b[2])));+ const x1 = Math.max(0, Math.min(width, Math.max(b[0], b[2])));+ const y0 = Math.max(0, Math.min(height, Math.min(b[1], b[3])));+ const y1 = Math.max(0, Math.min(height, Math.max(b[1], b[3])));+ return x1 > x0 && y1 > y0 ? [Math.floor(x0), Math.floor(y0), Math.ceil(x1), Math.ceil(y1)] : null;+}++/**+ * The scan's report (QWMDetect's JSON, pixels) as regions: the sure marks first and on, the less sure ones (rejected_boxes)+ * after them and off. Null when the words aren't a report.+ */+export function parseScanReport(text: string | undefined | null): ScanResult | null {+ if (!text) return null;+ let doc: unknown;+ try {+ doc = JSON.parse(text);+ } catch {+ return null;+ }+ if (!doc || typeof doc !== "object") return null;+ const d = doc as { image_size?: unknown; boxes?: unknown; rejected_boxes?: unknown; coordinate_space?: unknown };+ const size = Array.isArray(d.image_size) && d.image_size.length === 2 && d.image_size.every((n) => finite(n) && n > 0) ? (d.image_size as [number, number]) : null;+ if (!size || (d.coordinate_space !== undefined && d.coordinate_space !== "pixels")) return null;+ const [width, height] = size;+ const regions: Region[] = [];+ const take = (list: unknown, on: boolean) => {+ if (!Array.isArray(list)) return;+ for (const item of list) {+ if (!item || typeof item !== "object") continue;+ const it = item as { bbox?: unknown; source_bbox?: unknown; overlay_type?: unknown; label?: unknown; confidence?: unknown };+ const repair = box4(it.bbox) && ordered(box4(it.bbox)!, width, height);+ if (!repair) continue;+ const tight = (box4(it.source_bbox) && ordered(box4(it.source_bbox)!, width, height)) || repair;+ const type = normalizeType(it.overlay_type);+ const label = cleanLabel(it.label);+ const sure = on && (!finite(it.confidence) || it.confidence >= SURE);+ regions.push({ id: `r${regions.length + 1}`, type, label, chip: chipFor(type, label), box: tight, repair, on: sure });+ }+ };+ take(d.boxes, true);+ take(d.rejected_boxes, false);+ return { width, height, regions };+}++/** The region a tap at (x, y) in pixels picks: the smallest one under it, with a margin so small marks are easy to hit. */+export function regionAt(regions: Region[], x: number, y: number, margin = 0): Region | null {+ let best: Region | null = null;+ let area = Infinity;+ for (const r of regions) {+ const [x0, y0, x1, y1] = r.box;+ if (x < x0 - margin || x > x1 + margin || y < y0 - margin || y > y1 + margin) continue;+ const a = (x1 - x0) * (y1 - y0);+ if (a < area) {+ best = r;+ area = a;+ }+ }+ return best;+}++/** The header over the regions: "Found 3. Tap any you want to keep." */+export function foundLine(count: number): string {+ return count === 1 ? "Found 1. Tap it if you want to keep it." : `Found ${count}. Tap any you want to keep.`;+}++/** The main button: "Remove 3", or "Everything is kept" when every mark is kept. */+export function removeLabel(on: number): string {+ return on > 0 ? `Remove ${on}` : "Everything is kept";+}++/** The marks to remove as the request's params.extra.boxes (pixels, the pack's manual_boxes JSON). */+export function keptBoxesJson(regions: Region[]): string {+ const boxes = regions+ .filter((r) => r.on)+ .map((r) => ({ bbox: r.repair, source_bbox: r.box, overlay_type: r.type, label: r.label }));+ return JSON.stringify({ coordinate_space: "pixels", boxes });+}++function cleanLabel(v: unknown): string {+ return String(v ?? "")+ .replace(/[\u0000-\u001f\u007f-\u009f]/g, " ")+ .replace(/\s+/g, " ")+ .trim()+ .slice(0, MAX_LABEL);+}++/**+ * The kept marks as they may reach the graph: JSON, 1–32 boxes of 4 finite numbers, clamped to the picture (its size when+ * known, else 16384 px), each with an area, a known type (else "unknown"), a label of at most 80 characters with no control+ * characters, in pixels. Rebuilt from scratch: nothing the client sent passes through as it was. Throws in words.+ */+export function checkWatermarkBoxes(raw: unknown, size?: { width?: number; height?: number }): { json: string; count: number } {+ let doc: unknown = raw;+ if (typeof raw === "string") {+ try {+ doc = JSON.parse(raw);+ } catch {+ throw new Error("The marks to remove couldn't be read. Scan the picture again.");+ }+ }+ const list = Array.isArray(doc) ? doc : doc && typeof doc === "object" ? (doc as { boxes?: unknown }).boxes : undefined;+ if (!Array.isArray(list)) throw new Error("The marks to remove couldn't be read. Scan the picture again.");+ if (list.length > MAX_BOXES) throw new Error(`Pick up to ${MAX_BOXES} marks at a time`);+ const width = size?.width && size.width > 0 ? size.width : 16384;+ const height = size?.height && size.height > 0 ? size.height : 16384;+ const boxes: { bbox: Box; source_bbox?: Box; overlay_type: OverlayType; label: string }[] = [];+ for (const item of list) {+ if (!item || typeof item !== "object") continue;+ const it = item as { bbox?: unknown; source_bbox?: unknown; overlay_type?: unknown; label?: unknown };+ const b = box4(it.bbox);+ const bbox = b && ordered(b, width, height);+ if (!bbox) continue;+ const s = box4(it.source_bbox);+ const source = s && ordered(s, width, height);+ boxes.push({ bbox, ...(source && { source_bbox: source }), overlay_type: normalizeType(it.overlay_type), label: cleanLabel(it.label) || "watermark" });+ }+ if (!boxes.length) throw Object.assign(new Error(COPY.noneKept), { status: 400 });+ return { json: JSON.stringify({ coordinate_space: "pixels", boxes }), count: boxes.length };+}++/** The longest side the repair works at: 1024; 1536 for a picture past 3000 px; 768 on a GPU with under 16 GB. */+export function maxSideFor(width?: number, height?: number, vramBytes?: number): number {+ if (vramBytes && vramBytes > 0 && vramBytes < 16 * 2 ** 30) return 768;+ if (Math.max(width ?? 0, height ?? 0) > 3000) return 1536;+ return 1024;+}++/** The repair's verdict (QWMFinal's report) as kept on the result's meta.quality. */+export interface WatermarkQuality {+ status: string;+ selectedPass?: number;+ outsideMaskMaxDifference?: number;+ needsReview?: boolean;+ reasons?: string[];+}++export function qualityOf(text: string | undefined | null): WatermarkQuality | null {+ if (!text) return null;+ try {+ const r = JSON.parse(text) as Record<string, unknown>;+ if (!r || typeof r !== "object" || typeof r.status !== "string") return null;+ return {+ status: r.status,+ ...(finite(r.selected_pass) && { selectedPass: r.selected_pass }),+ ...(finite(r.outside_mask_max_difference) && { outsideMaskMaxDifference: r.outside_mask_max_difference }),+ ...(typeof r.needs_review === "boolean" && { needsReview: r.needs_review }),+ ...(Array.isArray(r.reasons) && { reasons: r.reasons.filter((x): x is string => typeof x === "string").slice(0, 12) }),+ };+ } catch {+ return null;+ }+}++/** The original came back: the repair couldn't be made cleanly (the run fails in words, no new result). */+export const rejectedRepair = (q: WatermarkQuality | null | undefined): boolean => q?.status === "rejected_first_pass";diff --git a/src/server/generations.ts b/src/server/generations.tsindex 8271889b..97826385 100644--- a/src/server/generations.ts+++ b/src/server/generations.ts@@ -12,6 +12,7 @@ import { withSignatureWords } from "@/lib/catalog/palettes";import { applySketch, stripMotionPaths } from "@/lib/catalog/sketch";import { cueText, type Cue } from "@/lib/cues";import { HELPER_FEATURES, HELPER_SUFFIX, isReviewStatus, type AssetUse, type ReviewFilter } from "@/lib/library";+import { COPY as WATERMARK_COPY, rejectedRepair, type WatermarkQuality } from "@/lib/watermark";import { upscaleTier } from "@/lib/av/upscale";import { chainedWaitMessage, framesWait, keyframeChain } from "@/lib/catalog/keyframes";import { clipFpsProblem, clipSizeProblem, clipTotalProblem, clipWindowProblem, elementClipProblem, insertRangeProblem, portraitShapeProblem, sourceFrames, voiceWindowProblem } from "@/lib/catalog/clip-windows";@@ -2197,6 +2198,11 @@ async function pollOne(r: Row): Promise<void> {if (res.fix) markStale(account ? `acct:${account}` : "install");return;}+ // The Watermark Remover gave the original back (no clean repair was possible): no new result, the run says what to try.+ if (r.op === "watermark-remove" && (res.outputs as RichOutput[]).some((o) => rejectedRepair(o.meta?.quality as WatermarkQuality | undefined))) {+ update(r.id, { status: "failed", error: WATERMARK_COPY.rejected, completed_at: Date.now(), message: null });+ return;+ }// Mark first so a slow download isn't polled twice.update(r.id, { status: "running", progress: 0.99, message: "Saving results" });const outputs: OutputFile[] = [];diff --git a/src/server/gpu/gate.ts b/src/server/gpu/gate.tsindex be5efbb3..f624ad0b 100644--- a/src/server/gpu/gate.ts+++ b/src/server/gpu/gate.ts@@ -2,7 +2,7 @@ import "server-only";import crypto from "node:crypto";import { getModel } from "@/lib/catalog";import { controlSets } from "@/lib/catalog/plan";-import { resolveWorkflowId } from "@/lib/comfy-variants";+import { COMPANION_GRAPHS, resolveWorkflowId } from "@/lib/comfy-variants";import { fixPlan } from "@/lib/gpu/plan";import { CLEAN_VAE, DECODER_PARAM, GPU_PARAM } from "@/lib/qwen21-speed";import { H3_TIER_PARAM, H3_UNET_PARAM, withTierFile } from "@/lib/gpu/h3-tier";@@ -69,6 +69,7 @@ export async function gateGeneration(t: GpuTarget, g: GateInput): Promise<GateReformat: req.params?.format,audio2: !!req.inputs?.audio2 || !!req.params?.extra?.audio2,audio: !!req.inputs?.audio,+ mask: !!req.inputs?.mask,extra,has,});@@ -84,6 +85,8 @@ export async function gateGeneration(t: GpuTarget, g: GateInput): Promise<GateRe// MiniMax H3's FastH3 graphs load the card's own file (NVFP4 on Blackwell, fp8 without CUDA 13): that file is needed instead.const unet = extra[H3_UNET_PARAM];idx = withTierFile(idx, id, typeof unet === "string" ? unet : undefined);+ // The graph that runs, and the ones its next step is sure to run (the Watermark Remover's scan checks its removal too).+ const ids = [id, ...(COMPANION_GRAPHS[id] ?? []).filter(has)];// The preset's route on the run's model (the one its preview was made with, or its own): its LoRAs are checked too.const preset = req.presetId ? presetTool(req.presetId, { modelId: g.modelId }) : null;const model = modelTool(g.modelId, g.op);@@ -93,7 +96,7 @@ export async function gateGeneration(t: GpuTarget, g: GateInput): Promise<GateReconst ctx = { ...contextFor(t), kind: model?.kind };let snap = readSnapshot(t);if (!snap?.inventory.reachable) return { ok: true };- let r = toolReadiness(ref, name, [id], loras, snap.inventory, idx, ctx, model?.cloud);+ let r = toolReadiness(ref, name, ids, loras, snap.inventory, idx, ctx, model?.cloud);if (!blocks(r)) return { ok: true };// A ComfyUI on the person's computer is read by their tab, which checks the tool right before the run: only a check// from the last 10 s counts as confirmed (an older one never blocks; ComfyUI's own answer has the last word).@@ -105,7 +108,7 @@ export async function gateGeneration(t: GpuTarget, g: GateInput): Promise<GateReif (!fresh?.reachable) return { ok: true };snap = readSnapshot(t);if (!snap?.inventory.reachable) return { ok: true };- r = toolReadiness(ref, name, [id], loras, snap.inventory, idx, ctx, model?.cloud);+ r = toolReadiness(ref, name, ids, loras, snap.inventory, idx, ctx, model?.cloud);if (!blocks(r)) return { ok: true };}const dev = snap.inventory.devices[0];diff --git a/src/server/providers/comfyui.ts b/src/server/providers/comfyui.tsindex fcb6b9b7..06eb35f3 100644--- a/src/server/providers/comfyui.ts+++ b/src/server/providers/comfyui.ts@@ -45,6 +45,7 @@ import { fpsPlan } from "@/lib/av/fps";import { resolveWorkflowId } from "@/lib/comfy-variants";import { MOTION_GRAPHS, motionTransferPrompt, neutralPrompt, WORDS_NEEDED } from "@/lib/comfy-prompts";import { DECODER_PARAM, editCanvas, GPU_PARAM, LIGHTNING_GRAPHS, lightningSigmas, SPEED_PARAM, ZEN_ADAPTER, ZEN_ENCODER } from "@/lib/qwen21-speed";+import { checkWatermarkBoxes, COPY as WATERMARK_COPY, MAX_SIDE as MAX_WATERMARK_SIDE, maxSideFor, qualityOf } from "@/lib/watermark";import { h3Canvas, h3Frames, isH3Graph } from "@/lib/h3-prompt";import { draftSizeFor, REGEN_COPY, REGEN_WINDOW_SECONDS, REGEN_WORKFLOW, regenFrames, regenOnePassRefusal, regenResolution } from "@/lib/catalog/regenerate";import { carriesBoxes, LAYOUT_PARAM } from "@/lib/layout-prompt";@@ -513,11 +514,16 @@ export function collectOutputs(entry: HistoryEntry, manifest: ManifestWorkflow |.filter((o) => o.role === "frame").map((o) => parseOcrFrame(textsOf(outputs[o.node]).join("\n"))).find(Boolean);+ // The Watermark Remover's verdict (QWMFinal's report, a PreviewAny): kept on the picture's meta, never a result of its own.+ const quality = declared+ .filter((o) => o.role === "quality")+ .map((o) => qualityOf(textsOf(outputs[o.node]).join("\n")))+ .find(Boolean);const files: ComfyOutput[] = [];const pick = (type: string) => {for (const nodeId of order) {const spec: ManifestOutput | undefined = declared.find((o) => o.node === nodeId);- if (spec?.role === "language" || spec?.role === "frame") continue;+ if (spec?.role === "language" || spec?.role === "frame" || spec?.role === "quality") continue;const ui = outputs[nodeId] ?? {};const texts = textsOf(ui);const found: { key: string; f: HistoryFile }[] = [];@@ -552,6 +558,7 @@ export function collectOutputs(entry: HistoryEntry, manifest: ManifestWorkflow |if (spec?.role === "splat" && ext) meta.format = ext;// Qwen-Image-Layered saves its layers back to front.if (spec?.role === "layers") Object.assign(meta, { z: i, name: i === 0 ? "Background" : `Layer ${i}` });+ if (quality && kind === "image") meta.quality = quality;if (Object.keys(meta).length) o.meta = meta;files.push(o);});@@ -1050,6 +1057,8 @@ export interface PrepareContext {device?: () => Promise<string | undefined>;/** Where a model file is on the server's disk (comfyModelPath), undefined when it can't say: Zen Image Edit's loader reads paths. */modelPath?: (folder: string, name: string) => Promise<string | undefined>;+ /** The first device's memory in bytes (GET /system_stats devices[0].vram_total): the Watermark Remover's repair size. */+ vram?: () => Promise<number | undefined>;/** The DBS models on the server's disk (GET /models/dbs), undefined when it can't say: a run never gets one that isn't there. */dbsModels?: () => Promise<DbsModel[] | undefined>;/** The RE-USE files on the server's disk (GET /models/reuse): null without ComfyUI-RE-USE, undefined when it can't say. */@@ -1230,6 +1239,7 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,format: input.format,audio2: !!audio2 || !!extra.audio2,audio: !!input.audio,+ mask: !!input.mask,extra,has: (id) => loadManifest().workflows.some((w) => w.id === id),});@@ -1731,6 +1741,27 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,if (b.channels) values.channels = dbsChannelsFor(extra.channels, sourceChannels);for (const k of ["separationModel", "channels", "sourceChannels"]) delete extra[k];// Options → Prompt helper (FLUX 3 Image Klein) and a layout's draft (kept for Reuse): read here, never bound.+ // Watermark Remover: the marks kept (checked and rebuilt again, clamped to this picture), how QWMDetect finds what to repair,+ // and the size the repair works at (the picture's size and the GPU's memory). Never what the request says for these.+ if (manifest.capability === "watermark-remove") {+ const still = ctx.media?.(String(values.image ?? ""));+ if (still?.width && still.height && Math.max(still.width, still.height) > MAX_WATERMARK_SIDE) throw new ProviderError(WATERMARK_COPY.tooBig, 400);+ const brushed = !!b.mask;+ if (!brushed && extra.boxes !== undefined) {+ try {+ values.boxes = checkWatermarkBoxes(extra.boxes, { width: still?.width, height: still?.height }).json;+ } catch (e) {+ throw new ProviderError((e as Error).message, 400);+ }+ values.detectMode = "manual_boxes";+ } else if (b.detectMode) values.detectMode = brushed ? "manual_mask" : "auto_qwen";+ if (b.maxSize) values.maxSize = maxSideFor(still?.width, still?.height, await ctx.vram?.().catch(() => undefined));+ for (const k of ["boxes", "detectMode", "maxSize"]) delete extra[k];+ }+ if (manifest.capability === "watermark-scan") {+ const still = ctx.media?.(String(values.image ?? ""));+ if (still?.width && still.height && Math.max(still.width, still.height) > MAX_WATERMARK_SIDE) throw new ProviderError(WATERMARK_COPY.tooBig, 400);+ }const helper = extra[PROMPT_HELPER_PARAM];const laidOut = carriesBoxes(extra);delete extra[PROMPT_HELPER_PARAM];@@ -2367,6 +2398,13 @@ export const comfyProvider: ProviderAdapter = {},device: () => comfyDevice(worker),modelPath: (folder, name) => comfyModelPath(folder, name, worker),+ vram: async () => {+ const computer = computerScope();+ if (computer) return runnerFacts(computer)?.vramBytes;+ const s = await comfyJson<{ devices?: { vram_total?: unknown }[] }>("/system_stats", worker).catch(() => undefined);+ const v = s?.devices?.[0]?.vram_total;+ return typeof v === "number" && v > 0 ? v : undefined;+ },// Fresh: a model installed a moment ago runs. (On someone's computer, nothing to ask: its ComfyUI has the last word.)dbsModels: () => comfyDbsModels(worker, 0),reuseModels: () => comfyReuseModels(worker, 0),diff --git a/src/server/providers/mock.ts b/src/server/providers/mock.tsindex f3e8af52..81b84667 100644--- a/src/server/providers/mock.ts+++ b/src/server/providers/mock.ts@@ -7,6 +7,7 @@ import { H3_REMOVAL_WORKFLOW } from "@/lib/catalog/character-swap";import { HAND_OFF, windowArtifact } from "@/lib/catalog/remove-object";import { OPERATION_OUTPUT, type MediaKind, type Operation } from "@/lib/catalog/types";import { spectralColor } from "@/lib/scene3d";+import { imageSize } from "@/lib/image-size";import type { ProviderAdapter, RemoteOutput } from "./types";import { textOutput } from "./llm";import { encodePng } from "../png";@@ -235,6 +236,28 @@ function demoOcr(brief: string): DemoOutput {return textOutput(lines.map((l) => l.text).join("\n"), null, { lines, demo: true });}+/** The picture a data URI carries (the Watermark Remover's input, which the demo keeps whole), else null. */+function dataUriBytes(uri: unknown): Buffer | null {+ const m = typeof uri === "string" ? /^data:[^;,]+;base64,(.*)$/s.exec(uri) : null;+ return m ? Buffer.from(m[1], "base64") : null;+}++/**+ * The Watermark Remover's scan in demo mode: a report like the pack's (pixels), with a caption across the lower third and a+ * corner logo, sized to the picture (a 1000 x 1000 one when its size can't be read).+ */+export function demoWatermarkReport(image: unknown): string {+ const bytes = dataUriBytes(image);+ const size = (bytes && imageSize(bytes)) || { width: 1000, height: 1000 };+ const { width: w, height: h } = size;+ const px = (b: number[]) => [Math.round(b[0] * w), Math.round(b[1] * h), Math.round(b[2] * w), Math.round(b[3] * h)];+ const boxes = [+ { label: "caption text across the picture", bbox: px([0.14, 0.58, 0.86, 0.74]), source_bbox: px([0.18, 0.61, 0.82, 0.7]), overlay_type: "translucent_text_logo", mask_method: "rectangle", confidence: 0.92 },+ { label: "round logo in the corner", bbox: px([0.76, 0.06, 0.96, 0.24]), source_bbox: px([0.79, 0.08, 0.93, 0.21]), overlay_type: "text_logo", mask_method: "rectangle", confidence: 0.88 },+ ];+ return JSON.stringify({ coordinate_space: "pixels", image_size: [w, h], boxes, rejected_boxes: [], status: "detected", demo: true });+}+/** A black-and-white mask (white = the object) in the picture's shape. */function demoMaskSvg(ar: string): string {const [w, h] = ar === "9:16" || ar === "3:4" || ar === "2:3" ? [360, 640] : ar === "1:1" ? [512, 512] : [640, 360];@@ -348,6 +371,14 @@ function demoOutputs(op: Operation | undefined, kind: MediaKind, prompt: string,["other", [262, 392]],] as const).map(([stem, tones]) => ({ url: toDataUri(demoWav(3, [tones[0], tones[1]]), "audio/wav"), kind: "audio" as const, contentType: "audio/wav", meta: { stem, demo: true } }));+ // The Watermark Remover: two marks sized to the picture; the removal gives the picture back as it came (a demo).+ case "watermark-scan":+ return [textOutput(demoWatermarkReport(meta.image), null, { role: "report", demo: true })];+ case "watermark-remove": {+ const image = typeof meta.image === "string" && meta.image.startsWith("data:image/") ? meta.image : null;+ const contentType = image ? image.slice(5, image.indexOf(";")) : "image/svg+xml";+ return [{ url: image ?? svgUri(demoSvg("clean picture", ar, 6)), kind: "image", contentType, meta: { demo: true, quality: { status: "completed_clean_first_pass", selectedPass: 1, outsideMaskMaxDifference: 0, needsReview: false } } }];+ }// The same tone, as long as the loop was asked to be (or the clips joined end to end).case "audio-loop":return [{ url: toDataUri(demoWav(clamp(Math.round(Number(meta.duration ?? 12)), 4, 30)), "audio/wav"), kind: "audio", contentType: "audio/wav", meta: { demo: true } }];@@ -412,7 +443,9 @@ export const mockProvider: ProviderAdapter = {label: "Placeholder",isConfigured: () => true,- async prepareFile(data, contentType) {+ async prepareFile(data, contentType, _name, route) {+ // The Watermark Remover's picture is kept whole (its scan reads the size, its removal gives it back); others stay tiny.+ if ((route?.op === "watermark-scan" || route?.op === "watermark-remove") && contentType.startsWith("image/")) return toDataUri(data, contentType);return toDataUri(data.subarray(0, 64), contentType); // never sent anywhere; keep it tiny},@@ -450,6 +483,8 @@ export const mockProvider: ProviderAdapter = {h3Review: route.provider === "comfyui" && route.endpoint === H3_REMOVAL_WORKFLOW,// A stem split that also transcribes (ComfyUI's dub-prepare-separate-transcribe).transcript: route.op === "separate-audio" && route.provider === "comfyui" && route.endpoint.includes("transcribe"),+ // The Watermark Remover's picture (kept whole by prepareFile).+ image: route.op === "watermark-scan" || route.op === "watermark-remove" ? input.images?.[0] : undefined,// A dialogue / music / effects split (ComfyUI's separate-soundtrack-dbs): four stems.threeStems: route.op === "separate-audio" && route.endpoint === "separate-soundtrack-dbs",// DBS graph C (soundtrack-remix-dbs): one remixed track.diff --git a/tests/comfy-library-4.test.ts b/tests/comfy-library-4.test.tsindex 7cd53127..1cb779c9 100644--- a/tests/comfy-library-4.test.ts+++ b/tests/comfy-library-4.test.ts@@ -66,6 +66,8 @@ const ROLES: NonNullable<ManifestOutput["role"]>[] = ["sweep", "sweep-mask", "mesh",// Photo to 3D: the orbit clip of the splat that came with its GLB."orbit",+ // Watermark Remover: the repair's verdict, folded into the picture's meta.+ "quality",];describe("round-4 ComfyUI workflows", () => {@@ -114,6 +116,10 @@ describe("round-4 ComfyUI workflows", () => {"tts-qwen3-clone","tts-voxcpm2","tts-voxcpm2-clone",+ // Watermark Remover: ComfyUI-Qwen-Watermark isn't on the validation server yet; built from the committed subset.+ "image-watermark-scan-qwen3vl",+ "image-watermark-remove-qwen21",+ "image-watermark-remove-qwen21-brush","qwen-image-21-t2i","qwen-image-21-edit","qwen-image-21-turbo-edit",diff --git a/tests/e2e/watermark-remover.mjs b/tests/e2e/watermark-remover.mjsnew file mode 100644index 00000000..434f717b--- /dev/null+++ b/tests/e2e/watermark-remover.mjs@@ -0,0 +1,212 @@+// Browser check of the Watermark Remover app (its own page: scan, keep, remove, compare, brush, download).+// Usage: node tests/e2e/watermark-remover.mjs [appUrl] [outDir] [--guest guestAppUrl]+// appUrl: the app in demo mode (no keys; COMFYUI_URL pointing at nothing), signed in as the owner.+// --guest: the same build with public sign-up on, seen signed out.+// Checks, at 390 x 844 (taps) and 1440 px: the start screen; a photo added is scanned at once and its marks show with Text and+// Logo chips; a tap keeps a mark ("Remove 1"); Remove gives the result; a tap flips Before and After and a held press shows+// Before until it lets go; "Brush it" opens the brush and a stroke makes another pass (Undo then shows); Download is the PNG;+// ?image= scans at once; an empty scan says so and offers the brush; no sideways scroll; and, with --guest, that a guest+// is asked to sign up. Screenshots go to outDir. A page error fails the run.+import { spawnSync } from "node:child_process";+import fs from "node:fs";+import path from "node:path";+import { DESKTOP, PHONE, launch, openRoute } from "./_browser.mjs";++const argv = process.argv.slice(2);+const guestAt = argv.indexOf("--guest");+const guestApp = guestAt >= 0 ? argv[guestAt + 1] : null;+const args = argv.filter((a, i) => !a.startsWith("--") && i !== guestAt + 1);+const app = args[0] ?? "http://localhost:3000";+const out = args[1] ?? fs.mkdtempSync("/tmp/fuobe-watermark-");+fs.mkdirSync(out, { recursive: true });+const PAGE = "/apps/app-watermark-remover";++// A 1200 x 900 test photo.+const photo = path.join(out, "photo.png");+const r = spawnSync("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "testsrc2=s=1200x900:d=1", "-frames:v", "1", photo]);+if (r.status !== 0) throw new Error(`ffmpeg failed: ${r.stderr}`);++const failures = [];+const check = (ok, what) => {+ console.log(`${ok ? "✓" : "✗"} ${what}`);+ if (!ok) failures.push(what);+};+const noSideScroll = async (page, label) => {+ const over = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);+ check(over <= 0, `${label}: no horizontal scroll (${over}px)`);+};+async function setup(browser, device, theme = "light", base = app) {+ const ctx = await browser.newContext({ ...device, colorScheme: theme, acceptDownloads: true });+ ctx.on("page", (p) => p.on("pageerror", (e) => check(false, `${theme}: no page error (${String(e.message).slice(0, 160)})`)));+ await ctx.addInitScript(() => {+ try {+ localStorage.setItem("fuobe.engine", "open");+ } catch {}+ });+ // Nothing but the app.+ await ctx.route((u) => u.origin !== new URL(base).origin && /^https?:$/.test(u.protocol), (rt) => rt.abort());+ return ctx;+}+async function waitPhase(page, want, ms = 45_000) {+ await page.waitForFunction((w) => w.includes(document.querySelector("[data-wm-phase]")?.getAttribute("data-wm-phase") ?? ""), want, { timeout: ms });+}+/** A tap at the middle of an element (a touch on the phone, a click on the desktop). */+async function tapAt(page, locator, touch) {+ const b = await locator.boundingBox();+ if (!b) throw new Error("not on screen");+ if (touch) await page.touchscreen.tap(b.x + b.width / 2, b.y + b.height / 2);+ else await page.mouse.click(b.x + b.width / 2, b.y + b.height / 2);+}++const browser = await launch();+try {+ for (const [dname, device, theme] of [+ ["390", PHONE, "dark"],+ ["1440", DESKTOP, "light"],+ ]) {+ const touch = dname === "390";+ const label = `${dname} ${theme}`;+ const ctx = await setup(browser, device, theme);+ const page = await ctx.newPage();+ await openRoute(page, `${app}${PAGE}`);+ check(await page.getByRole("heading", { name: "Clean up a photo" }).isVisible(), `${label}: the start screen says what it does`);+ check(await page.getByRole("button", { name: "Add a photo" }).isVisible(), `${label}: Add a photo`);+ check(await page.getByRole("button", { name: "From Library" }).isVisible(), `${label}: From Library`);+ await page.screenshot({ path: path.join(out, `wm-start-${dname}.png`), fullPage: true });+ await noSideScroll(page, `${label} start`);++ // Add a photo: it is scanned at once.+ await page.locator("[data-wm-file]").setInputFiles(photo);+ await waitPhase(page, ["scanning", "regions"]);+ await page.screenshot({ path: path.join(out, `wm-scanning-${dname}.png`) });+ await waitPhase(page, ["regions"]);+ check(await page.getByRole("heading", { name: "Found 2. Tap any you want to keep." }).isVisible(), `${label}: the header counts the marks`);+ const chips = await page.locator("[data-wm-chip]").allInnerTexts();+ check(chips.some((c) => c.includes("Text")) && chips.some((c) => c.includes("Logo")), `${label}: Text and Logo chips (${chips.join(" | ")})`);+ check((await page.locator("[data-wm-remove]").innerText()).includes("Remove 2"), `${label}: Remove 2`);+ await page.screenshot({ path: path.join(out, `wm-regions-${dname}.png`), fullPage: true });+ await noSideScroll(page, `${label} regions`);++ // Tap the logo on the picture: kept.+ await tapAt(page, page.locator('[data-wm-region="r2"]'), touch);+ check((await page.locator('[data-wm-region="r2"]').getAttribute("data-on")) === null, `${label}: a tap keeps the mark`);+ check((await page.locator("[data-wm-remove]").innerText()).includes("Remove 1"), `${label}: Remove 1`);+ check((await page.locator('[data-wm-chip="r2"]').getAttribute("aria-pressed")) === "true", `${label}: its chip says kept`);+ // Both kept: nothing to remove.+ await page.locator('[data-wm-chip="r1"]').click();+ check((await page.locator("[data-wm-remove]").innerText()).includes("Everything is kept") && (await page.locator("[data-wm-remove]").isDisabled()), `${label}: everything kept disables Remove`);+ await page.locator('[data-wm-chip="r1"]').click();+ await page.screenshot({ path: path.join(out, `wm-kept-${dname}.png`) });++ // Remove.+ await page.locator("[data-wm-remove]").click();+ await waitPhase(page, ["result"]);+ check(true, `${label}: the result shows`);+ const cmp = page.locator("[data-wm-compare]");+ check((await cmp.getAttribute("data-wm-compare")) === "after", `${label}: the result opens on After`);+ await tapAt(page, cmp, touch);+ check((await cmp.getAttribute("data-wm-compare")) === "before", `${label}: a tap shows Before`);+ await tapAt(page, cmp, touch);+ check((await cmp.getAttribute("data-wm-compare")) === "after", `${label}: another tap goes back to After`);+ const b = await cmp.boundingBox();+ await page.mouse.move(b.x + b.width / 2, b.y + b.height / 2);+ await page.mouse.down();+ await page.waitForTimeout(450);+ check((await cmp.getAttribute("data-wm-compare")) === "before", `${label}: holding shows Before`);+ await page.mouse.up();+ check((await cmp.getAttribute("data-wm-compare")) === "after", `${label}: letting go shows After`);+ const dl = page.locator("[data-wm-download]");+ check(!!(await dl.getAttribute("download")) && /\.png$/.test(await dl.getAttribute("download")), `${label}: Download is a PNG (${await dl.getAttribute("download")})`);+ await page.screenshot({ path: path.join(out, `wm-result-${dname}.png`), fullPage: true });+ await noSideScroll(page, `${label} result`);++ // Brush a missed spot.+ await page.locator("[data-wm-brush]").click();+ const dialog = page.getByRole("dialog");+ await dialog.waitFor({ timeout: 15_000 });+ const canvas = dialog.locator("canvas").last();+ await canvas.waitFor({ timeout: 15_000 });+ const c = await canvas.boundingBox();+ await page.mouse.move(c.x + c.width * 0.3, c.y + c.height * 0.5);+ await page.mouse.down();+ await page.mouse.move(c.x + c.width * 0.6, c.y + c.height * 0.55, { steps: 8 });+ await page.mouse.up();+ await page.screenshot({ path: path.join(out, `wm-brush-${dname}.png`) });+ await dialog.getByRole("button", { name: /^Use this/ }).click();+ await waitPhase(page, ["removing", "result"]);+ await page.waitForFunction(() => document.querySelector("[data-wm-phase]")?.getAttribute("data-wm-phase") === "result" && [...document.querySelectorAll("button")].some((x) => x.textContent?.includes("Undo")), null, { timeout: 45_000 });+ check(true, `${label}: a brushed pass makes a new result, with Undo`);+ await ctx.close();+ }++ // ?image= hand-off: scanned at once.+ {+ const items = (await (await fetch(`${app}/api/generations?features=app:app-watermark-remover&statuses=succeeded&limit=1`)).json()).items ?? [];+ const url = items[0]?.outputs?.[0]?.url;+ check(!!url, "a result is in the Library");+ const ctx = await setup(browser, PHONE);+ const page = await ctx.newPage();+ await openRoute(page, `${app}${PAGE}?image=${encodeURIComponent(url)}`);+ await waitPhase(page, ["regions"]);+ check(true, "?image= scans at once and shows the marks");+ await page.screenshot({ path: path.join(out, "wm-handoff-390.png") });+ await ctx.close();+ }++ // An empty scan: the report says nothing was found (the live stream is cut so the poll carries the answer).+ {+ const ctx = await setup(browser, PHONE);+ await ctx.route("**/api/generations/stream", (rt) => rt.abort());+ await ctx.route(/\/api\/generations\/[^/?]+$/, async (rt) => {+ if (rt.request().url().endsWith("/stream")) return rt.abort();+ if (rt.request().method() !== "GET") return rt.continue();+ const res = await rt.fetch();+ const g = await res.json();+ if (g?.op === "watermark-scan" && g.status === "succeeded") g.outputs = g.outputs.map((o) => (o.kind === "text" ? { ...o, text: JSON.stringify({ coordinate_space: "pixels", image_size: [1200, 900], boxes: [], rejected_boxes: [], status: "no_overlay_detected" }) } : o));+ await rt.fulfill({ response: res, json: g });+ });+ const page = await ctx.newPage();+ await openRoute(page, `${app}${PAGE}`);+ await page.locator("[data-wm-file]").setInputFiles(photo);+ await waitPhase(page, ["empty"]);+ check(await page.getByText("Nothing to remove found. Brush the area you want gone.").isVisible(), "an empty scan says so");+ check(await page.getByRole("button", { name: "Brush it" }).isVisible(), "and offers the brush");+ await page.screenshot({ path: path.join(out, "wm-empty-390.png") });+ await noSideScroll(page, "390 empty");+ await ctx.close();+ }++ // A guest is asked to sign up before a photo goes anywhere.+ if (guestApp) {+ const ctx = await setup(browser, PHONE, "light", guestApp);+ const page = await ctx.newPage();+ await openRoute(page, `${guestApp}${PAGE}`);+ check(await page.getByRole("heading", { name: "Clean up a photo" }).isVisible(), "guest: the start screen");+ const chooser = page.waitForEvent("filechooser", { timeout: 3000 }).then(() => true).catch(() => false);+ await page.getByRole("button", { name: "Add a photo" }).click();+ const asked = await page+ .getByText("Create a free account to add your own files")+ .first()+ .waitFor({ timeout: 10_000 })+ .then(() => true)+ .catch(() => false);+ check(asked, "guest: Add a photo asks to create an account");+ check(!(await chooser), "guest: no file chooser opens");+ await page.screenshot({ path: path.join(out, "wm-guest-390.png") });+ // ?image= from a link: the scan is a run, so the guest gets the run's card and the page says it in words.+ await openRoute(page, `${guestApp}${PAGE}?image=${encodeURIComponent("/previews/presets/app-remove-background.jpg")}`);+ const runCard = await page+ .getByText("Create a free account to run this")+ .first()+ .waitFor({ timeout: 15_000 })+ .then(() => true)+ .catch(() => false);+ check(runCard, "guest: a hand-off asks to create an account to run it");+ await page.screenshot({ path: path.join(out, "wm-guest-handoff-390.png") });+ await ctx.close();+ }+} finally {+ await browser.close();+}+console.log(failures.length ? `\n${failures.length} check(s) failed` : "\nAll checks passed");+process.exitCode = failures.length ? 1 : 0;diff --git a/tests/library-pure.test.ts b/tests/library-pure.test.tsindex 813b0728..c0ed1ec0 100644--- a/tests/library-pure.test.ts+++ b/tests/library-pure.test.ts@@ -75,6 +75,7 @@ describe("outputActions", () => {"menu:recolor","menu:upscale","menu:new-angle",+ "menu:remove-watermark","menu:reference","menu:grade","menu:layers",diff --git a/tests/preset-covers.test.ts b/tests/preset-covers.test.tsindex 2a4fb1f1..223c61ec 100644--- a/tests/preset-covers.test.ts+++ b/tests/preset-covers.test.ts@@ -201,7 +201,9 @@ describe("the preset covers manifest", () => {// above the upload: a tool of its own, whose chunk loads on that app's page only.// The navigation's covers and the search index's are resolved on the server: nav-covers.ts is server-only (the// studios layout passes them down as props) and palette-index.ts is read by the prerendered GET /api/search-index.+ // The app page (a server page) hands the Watermark Remover's demo its cover.expect(importers(/^import (?!type )[^;]*from "[^"]*preset-covers";/m)).toEqual([+ "app/(studio)/apps/[id]/page.tsx","components/any-angle/any-angle-tool.tsx","components/cinema/move-list.tsx","components/preset-header.tsx",diff --git a/tests/watermark-remover.test.ts b/tests/watermark-remover.test.tsnew file mode 100644index 00000000..d549d4ce--- /dev/null+++ b/tests/watermark-remover.test.ts@@ -0,0 +1,441 @@+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { afterAll, beforeAll, describe, expect, it } from "vitest";+import type { Generation, GenInput } from "@/lib/catalog/types";+import type { ComfyWorkflow, Manifest, ManifestWorkflow } from "@/lib/comfy";++// The Watermark Remover app (ComfyUI-Qwen-Watermark): the app and its hidden models, the three graphs and their pins, which+// graph runs and how the provider fills it, the kept marks' checks, the scan report read into regions, the repair's verdict+// kept as meta, the Library's hiding of scans, licences, the Library action, search words, the Edit link, the demo, and the+// visitor words.+const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-watermark-"));+process.env.FUOBE_DATA_DIR = dir;+process.env.COMFYUI_URL = "http://127.0.0.1:9"; // nothing listens here: open runs fall back to the demo++const { setSetting } = await import("@/server/settings");+const { createGenerations, ensureRunner, getGeneration } = await import("@/server/generations");+const { saveFile } = await import("@/server/storage");+const { encodePng } = await import("@/server/png");+const { demoWatermarkReport, mockProvider } = await import("@/server/providers/mock");+const { collectOutputs, prepareWorkflow } = await import("@/server/providers/comfyui");+const { APPS, getModel, getPreset, MODELS } = await import("@/lib/catalog");+const { planGeneration } = await import("@/lib/catalog/plan");+const { OPERATION_OUTPUT } = await import("@/lib/catalog/types");+const { resolveWorkflowId, COMPANION_GRAPHS, WATERMARK_BRUSH_GRAPH } = await import("@/lib/comfy-variants");+const { HELPER_FEATURES, isHelperFeature } = await import("@/lib/library");+const { buildLicenceList, nodePack, workflowLicence } = await import("@/lib/licences");+const { outputActions } = await import("@/lib/output-actions");+const { APP_KEYWORDS } = await import("@/lib/command-search");+const { EDIT_STUDIO } = await import("@/lib/studios");+const { PRESET_ICONS } = await import("@/components/preset-icons");+const { commandsFor } = await import("@/lib/gpu/commands");+const { emptyInventory } = await import("@/lib/gpu/gather");+const W = await import("@/lib/watermark");++beforeAll(() => setSetting("demoMode", "auto"));+afterAll(() => {+ try {+ fs.rmSync(dir, { recursive: true, force: true });+ } catch {+ // Windows keeps the database file open a moment longer.+ }+});++const root = path.resolve(__dirname, "..");+const read = (p: string) => fs.readFileSync(path.join(root, p), "utf8");+const manifest = JSON.parse(read("workflows/comfyui/manifest.json")) as Manifest;+const entry = (id: string) => manifest.workflows.find((w) => w.id === id) as ManifestWorkflow;+const graph = (id: string) => JSON.parse(read(`workflows/comfyui/${id}.json`)) as ComfyWorkflow;+const requirements = JSON.parse(read("workflows/comfyui/requirements.json"));+const packs = JSON.parse(read("workflows/comfyui/packs.json"));+const pins = JSON.parse(read("workflows/comfyui/model-pins.json"));+const install = read("scripts/comfy/install-comfyui.sh");++const SCAN = "image-watermark-scan-qwen3vl";+const REMOVE = "image-watermark-remove-qwen21";+const BRUSH = "image-watermark-remove-qwen21-brush";+const PIN = "eef829d34d6e9d0d2ae0c1386fab7371a864cf34";+const SAM_URL = "https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth";+const SAM_SHA = "ec2df62732614e57411cdcf32a23ffdf28910380d03139ee0f4fcbe91eb8c912";+const LIVE_EDIT_FILES = ["diffusion_models/qwen_image_2.1_int8_convrot.safetensors", "text_encoders/qwen3vl_8b_int8_convrot.safetensors", "vae/qwen_image_2.1_vae_bf16.safetensors"];++/** A pack report like QWMDetect's, in pixels. */+const REPORT = JSON.stringify({+ coordinate_space: "pixels",+ image_size: [1000, 800],+ boxes: [+ { label: "stock site URL text", bbox: [80, 560, 920, 700], source_bbox: [120, 590, 880, 670], overlay_type: "translucent_text_logo", confidence: 0.93 },+ { label: "round brand mark", bbox: [760, 40, 980, 220], source_bbox: [790, 60, 950, 200], overlay_type: "text_logo", confidence: 0.81 },+ { label: "pasted cartoon", bbox: [10, 10, 200, 260], source_bbox: [30, 30, 180, 240], overlay_type: "irregular_sticker", confidence: 0.9 },+ ],+ rejected_boxes: [{ label: "faint mark", bbox: [400, 300, 520, 360], source_bbox: [410, 310, 510, 350], overlay_type: "rectangle", confidence: 0.4 }],+ status: "needs_review",+});++async function prepare(id: string, input: GenInput, ctx: { media?: Record<string, { width: number; height: number }>; vram?: number } = {}) {+ const res = await prepareWorkflow(id, input, {+ generationId: "g",+ op: id === SCAN ? "watermark-scan" : "watermark-remove",+ upload: async (_d, _t, name) => `up_${name}`,+ media: (name) => (ctx.media?.[name] ? { container: "image", hasVideo: false, ...ctx.media[name] } : undefined) as never,+ vram: async () => ctx.vram,+ });+ return { wf: res.workflow, id: res.manifest.id };+}++function png(w: number, h: number): Buffer {+ const data = Buffer.alloc(w * h * 4);+ for (let i = 0; i < w * h; i++) data.set([(i * 13) % 255, 120, 200, 255], i * 4);+ return encodePng({ width: w, height: h, data });+}++describe("1. the app", () => {+ it("is a Utility app with a page of its own, open source only, on the remover's route", () => {+ const app = APPS.find((a) => a.id === "app-watermark-remover")!;+ expect(app).toMatchObject({ type: "app", category: "Utility", tool: "watermark", cloud: null, userPrompt: "none", name: "Watermark Remover" });+ expect(app.look?.icon).toBe("ScanLine");+ expect(app.badges).toContain("new");+ expect(app.open).toMatchObject({ modelId: "oss-watermark-remover", op: "watermark-remove" });+ expect(PRESET_ICONS.ScanLine).toBeDefined();+ expect(app.description).toBe(W.COPY.tagline.replace(/\.$/, ""));+ });+});++describe("2. the hidden models", () => {+ it("route the scan and the removal to their graphs", () => {+ const scan = getModel("oss-watermark-scan")!;+ const remove = getModel("oss-watermark-remover")!;+ expect(scan).toMatchObject({ hidden: true, engine: "open", kind: "text" });+ expect(remove).toMatchObject({ hidden: true, engine: "open", kind: "image" });+ expect(scan.routes).toEqual([expect.objectContaining({ op: "watermark-scan", provider: "comfyui", endpoint: SCAN })]);+ expect(remove.routes).toEqual([expect.objectContaining({ op: "watermark-remove", provider: "comfyui", endpoint: REMOVE })]);+ expect(remove.options).toMatchObject({ maxImages: 1, promptOptional: true, seed: true });+ });+});++describe("3. the ops", () => {+ it("make text and an image, need no words, and ask for the picture in plain words", () => {+ expect(OPERATION_OUTPUT["watermark-scan"]).toBe("text");+ expect(OPERATION_OUTPUT["watermark-remove"]).toBe("image");+ const p = planGeneration({ feature: W.WATERMARK_SCAN_FEATURE, modelId: "oss-watermark-scan", op: "watermark-scan", inputs: { images: ["/a.png"] } }, getModel, getPreset);+ expect(p.op).toBe("watermark-scan");+ expect(() => planGeneration({ feature: "x", modelId: "oss-watermark-scan", op: "watermark-scan" }, getModel, getPreset)).toThrow("Add the picture to check");+ expect(() => planGeneration({ feature: "x", modelId: "oss-watermark-remover", op: "watermark-remove" }, getModel, getPreset)).toThrow("Add the picture to clean");+ });+});++describe("4. the manifest entries", () => {+ it("binds the picture, both seeds, the kept marks, the mode, the size and (brush) the mask", () => {+ expect(entry(SCAN)).toMatchObject({ capability: "watermark-scan", bindings: { image: [{ node: "1", input: "image" }] }, outputs: [{ node: "23", kind: "text", role: "report" }] });+ for (const id of [REMOVE, BRUSH]) {+ const e = entry(id);+ expect(e.capability).toBe("watermark-remove");+ expect(e.bindings.seed).toEqual([{ node: "12", input: "seed" }, { node: "30", input: "seed" }]);+ expect(e.bindings.maxSize).toEqual([{ node: "5", input: "max_side" }, { node: "28", input: "max_side" }]);+ expect(e.outputs).toEqual([{ node: "33", kind: "image" }, { node: "38", kind: "text", role: "quality" }]);+ expect(e.limits).toMatchObject({ maxWidth: 4096, maxHeight: 4096 });+ }+ expect(entry(REMOVE).bindings).toMatchObject({ detectMode: [{ node: "3", input: "mode" }], boxes: [{ node: "3", input: "boxes_json" }] });+ expect(entry(BRUSH).bindings.mask).toEqual([{ node: "50", input: "image" }]);+ expect(entry(BRUSH).bindings.boxes).toBeUndefined();+ });++ it("names the pack and uses Live edit's Qwen files plus SAM ViT-B", () => {+ for (const id of [SCAN, REMOVE, BRUSH]) expect(entry(id).customNodes).toEqual([{ name: "ComfyUI-Qwen-Watermark", repo: `https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/${PIN}` }]);+ for (const id of [REMOVE, BRUSH]) expect(entry(id).models.map((m) => `${m.folder}/${m.file}`).sort()).toEqual([...LIVE_EDIT_FILES, "sams/sam_vit_b_01ec64.pth"].sort());+ expect(entry(SCAN).models.map((m) => `${m.folder}/${m.file}`)).toEqual(["text_encoders/qwen3vl_8b_int8_convrot.safetensors"]);+ });+});++describe("5. the graph files", () => {+ it("keep only the declared outputs, run the int8 UNET, and route the brush's mask to QWMDetect", () => {+ const outputsOf = (g: ComfyWorkflow) => Object.entries(g).filter(([, n]) => /^(SaveImage|PreviewImage|PreviewAny|MaskPreview)$/.test(n.class_type)).map(([id]) => id).sort();+ expect(outputsOf(graph(SCAN))).toEqual(["23"]);+ expect(graph(SCAN)["23"].inputs.source).toEqual(["3", 1]);+ for (const id of [REMOVE, BRUSH]) {+ const g = graph(id);+ expect(outputsOf(g)).toEqual(["33", "38"]);+ expect(g["6"].inputs.unet_name).toBe("qwen_image_2.1_int8_convrot.safetensors");+ expect(g["33"].inputs.images).toEqual(["37", 0]);+ expect(g["38"].inputs.source).toEqual(["37", 2]);+ for (const n of Object.values(g)) expect(n.class_type).not.toMatch(/^(MaskToImage)$/);+ }+ const b = graph(BRUSH);+ expect(b["50"]).toMatchObject({ class_type: "LoadImageMask", inputs: { channel: "red" } });+ expect(b["3"].inputs).toMatchObject({ mode: "manual_mask", manual_mask: ["50", 0] });+ });+});++describe("6. requirements and pins", () => {+ it("pins the pack, its folder, SAM with its SHA-256, and installs segment-anything by name instead of the pack's requirements", () => {+ expect(packs["ComfyUI-Qwen-Watermark"]).toMatchObject({ repo: "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark", commit: PIN, subdir: null, folders: ["sams"], requirementsTxt: false, pip: ["segment-anything==1.0"] });+ expect(install).toContain(`[ComfyUI-Qwen-Watermark]="https://github.com/overflowofedge/ComfyUI-Qwen-Watermark ${PIN}"`);+ expect(install).toContain(`${SAM_SHA} sam_vit_b_01ec64.pth.part`);+ expect(pins[SAM_URL]).toEqual({ revision: "7790786db131bcdc639f24a915d9f2c331d843ee", sizeBytes: 375042383, sha256: SAM_SHA });+ expect(requirements.packs["ComfyUI-Qwen-Watermark"]).toMatchObject({ commit: PIN, folders: ["sams"], requirementsTxt: false, pip: ["segment-anything==1.0"] });+ expect(requirements.files["sams/sam_vit_b_01ec64.pth"]).toMatchObject({ url: SAM_URL, pinnedUrl: SAM_URL, sizeBytes: 375042383, sha256: SAM_SHA, presence: "unobservable" });+ expect(requirements.workflows[REMOVE].packs["ComfyUI-Qwen-Watermark"]).toEqual(["QWMComposite", "QWMDetect", "QWMFinal", "QWMPrepare", "QWMRefineMask", "QWMResidualDetect"]);+ });++ it("writes the pinned packages, never the requirements file, in the setup commands", () => {+ const inv = emptyInventory("server", 1);+ const c = commandsFor([{ kind: "pack-install", pack: "ComfyUI-Qwen-Watermark" }], { inv, idx: requirements });+ for (const shell of [c.bash, c.powershell]) {+ expect(shell).toContain("-m pip install segment-anything==1.0");+ expect(shell).not.toContain("requirements.txt");+ expect(shell).toContain(`checkout ${PIN}`);+ }+ });+});++describe("7. which graph runs", () => {+ const base = { op: "watermark-remove", clips: 0, images: 1, audio2: false, extra: {}, has: () => true };+ it("runs the brush graph with a mask, the boxes graph without, and checks the removal along with a scan", () => {+ expect(WATERMARK_BRUSH_GRAPH[REMOVE]).toBe(BRUSH);+ expect(resolveWorkflowId(REMOVE, base)).toBe(REMOVE);+ expect(resolveWorkflowId(REMOVE, { ...base, mask: true })).toBe(BRUSH);+ expect(resolveWorkflowId(REMOVE, { ...base, mask: true, has: (id) => id !== BRUSH })).toBe(REMOVE);+ expect(COMPANION_GRAPHS[SCAN]).toEqual([REMOVE]);+ });++ it("prepareWorkflow picks the same graph", async () => {+ expect((await prepare(REMOVE, { images: ["a.png"], mask: "m.png" })).id).toBe(BRUSH);+ expect((await prepare(REMOVE, { images: ["a.png"] })).id).toBe(REMOVE);+ });+});++describe("8. how the provider fills the removal", () => {+ const boxes = JSON.stringify({ boxes: [{ bbox: [10, 20, 300, 120], overlay_type: "text_logo", label: "caption" }] });+ it("seeds both passes at random, per run", async () => {+ const a = (await prepare(REMOVE, { images: ["a.png"], extra: { boxes } })).wf;+ const b = (await prepare(REMOVE, { images: ["a.png"], extra: { boxes } })).wf;+ expect(a["12"].inputs.seed).toBe(a["30"].inputs.seed);+ expect(a["12"].inputs.seed).not.toBe(802146);+ expect(a["12"].inputs.seed).not.toBe(b["12"].inputs.seed);+ });++ it("kept marks: manual_boxes with clean JSON clamped to the picture", async () => {+ const { wf } = await prepare(REMOVE, { images: ["a.png"], extra: { boxes: JSON.stringify({ boxes: [{ bbox: [-50, 20, 3000, 120], overlay_type: "weird", label: "caption" }] }) } }, { media: { "a.png": { width: 1200, height: 800 } } });+ expect(wf["1"].inputs.image).toBe("a.png");+ expect(wf["3"].inputs.mode).toBe("manual_boxes");+ expect(JSON.parse(String(wf["3"].inputs.boxes_json))).toEqual({ coordinate_space: "pixels", boxes: [{ bbox: [0, 20, 1200, 120], overlay_type: "unknown", label: "caption" }] });+ });++ it("a brush: manual_mask on the brush graph, the mask on its loader", async () => {+ const { wf } = await prepare(REMOVE, { images: ["a.png"], mask: "m.png", extra: { boxes } });+ expect(wf["3"].inputs.mode).toBe("manual_mask");+ expect(wf["50"].inputs.image).toBe("m.png");+ });++ it("no marks from an API caller: the pack finds them itself", async () => {+ expect((await prepare(REMOVE, { images: ["a.png"] })).wf["3"].inputs.mode).toBe("auto_qwen");+ });++ it("the repair size follows the picture and the GPU, never the request", async () => {+ const size = async (media: { width: number; height: number } | undefined, vram?: number) =>+ (await prepare(REMOVE, { images: ["a.png"], extra: { boxes, maxSize: 4096, detectMode: "auto_qwen" } }, { media: media && { "a.png": media }, vram })).wf;+ const plain = await size({ width: 1600, height: 1200 });+ expect([plain["5"].inputs.max_side, plain["28"].inputs.max_side]).toEqual([1024, 1024]);+ expect(plain["3"].inputs.mode).toBe("manual_boxes");+ expect((await size({ width: 4000, height: 3000 }))["5"].inputs.max_side).toBe(1536);+ expect((await size({ width: 4000, height: 3000 }, 12 * 2 ** 30))["28"].inputs.max_side).toBe(768);+ expect(W.maxSideFor(1000, 1000, 32 * 2 ** 30)).toBe(1024);+ });++ it("refuses a picture over 4096 px in words", async () => {+ await expect(prepare(REMOVE, { images: ["a.png"], extra: { boxes } }, { media: { "a.png": { width: 5000, height: 3000 } } })).rejects.toThrow(W.COPY.tooBig);+ await expect(prepare(SCAN, { images: ["a.png"] }, { media: { "a.png": { width: 300, height: 4100 } } })).rejects.toThrow(W.COPY.tooBig);+ });+});++describe("9. the kept marks' checks", () => {+ const check = W.checkWatermarkBoxes;+ it("refuses what can't be read, nothing at all, and too many", () => {+ expect(() => check("{nope")).toThrow(/couldn't be read/);+ expect(() => check(JSON.stringify({ boxes: [] }))).toThrow("Pick at least one mark to remove");+ expect(() => check(JSON.stringify({ boxes: [{ bbox: [NaN, 0, 1, 1] }, { bbox: [5, 5, 5, 9] }] }))).toThrow("Pick at least one mark to remove");+ expect(() => check({ boxes: Array.from({ length: 33 }, () => ({ bbox: [0, 0, 10, 10] })) })).toThrow("Pick up to 32 marks at a time");+ expect(check({ boxes: Array.from({ length: 32 }, () => ({ bbox: [0, 0, 10, 10] })) }).count).toBe(32);+ });++ it("clamps, orders, types, trims labels and forces pixels", () => {+ const r = JSON.parse(check({ coordinate_space: "xyxy_1000", boxes: [{ bbox: [500, 400, -20, 10], source_bbox: [1, 2, 3, 4], overlay_type: "MOSAIC", label: `x\u0000y${"z".repeat(200)}` }] }, { width: 300, height: 200 }).json);+ expect(r.coordinate_space).toBe("pixels");+ expect(r.boxes[0].bbox).toEqual([0, 10, 300, 200]);+ expect(r.boxes[0].source_bbox).toEqual([1, 2, 3, 4]);+ expect(r.boxes[0].overlay_type).toBe("mosaic");+ expect(r.boxes[0].label).toHaveLength(80);+ expect(r.boxes[0].label.startsWith("x y")).toBe(true);+ expect(Object.keys(r.boxes[0]).sort()).toEqual(["bbox", "label", "overlay_type", "source_bbox"]);+ });++ it("is checked when the run is planned: a 400 in words, and a brushed run drops the boxes", () => {+ const req = (extra: Record<string, unknown>, mask?: string) =>+ planGeneration({ feature: W.WATERMARK_FEATURE, presetId: "app-watermark-remover", modelId: "oss-watermark-remover", op: "watermark-remove", inputs: { images: ["/a.png"], ...(mask && { mask }) }, params: { extra } }, getModel, getPreset);+ expect(() => req({ boxes: JSON.stringify({ boxes: [] }) })).toThrow("Pick at least one mark to remove");+ expect(JSON.parse(String(req({ boxes: JSON.stringify({ boxes: [{ bbox: [0, 0, 5, 5], extra: "dropped" }] }) }).params.extra?.boxes))).toEqual({ coordinate_space: "pixels", boxes: [{ bbox: [0, 0, 5, 5], overlay_type: "unknown", label: "watermark" }] });+ expect(req({ boxes: "nonsense" }, "/m.png").params.extra?.boxes).toBeUndefined();+ });+});++describe("10. the scan report, read into regions", () => {+ it("outlines the tight boxes, maps the chips, and starts the less sure marks kept", () => {+ const s = W.parseScanReport(REPORT)!;+ expect([s.width, s.height]).toEqual([1000, 800]);+ expect(s.regions.map((r) => [r.chip, r.on])).toEqual([+ ["Text", true],+ ["Logo", true],+ ["Sticker", true],+ ["Block", false],+ ]);+ expect(s.regions[0].box).toEqual([120, 590, 880, 670]);+ expect(s.regions[0].repair).toEqual([80, 560, 920, 700]);+ expect(W.parseScanReport("not json")).toBeNull();+ expect(W.parseScanReport(JSON.stringify({ coordinate_space: "xyxy_1000", image_size: [10, 10], boxes: [] }))).toBeNull();+ expect(W.parseScanReport(JSON.stringify({ coordinate_space: "pixels", image_size: [10, 10], boxes: [] }))!.regions).toEqual([]);+ });++ it("names the chips from the type and the scan's words", () => {+ expect(W.chipFor("text_logo", "a website URL")).toBe("Text");+ expect(W.chipFor("translucent_text_logo", "©2024 photographer signature")).toBe("Text");+ expect(W.chipFor("text_logo", "a round emblem")).toBe("Logo");+ expect(W.chipFor("mosaic")).toBe("Mosaic");+ expect(W.chipFor("irregular_sticker")).toBe("Sticker");+ expect(W.chipFor("rectangle")).toBe("Block");+ expect(W.chipFor("unknown")).toBe("Mark");+ });++ it("a tap picks the smallest region under it; the counts and the request follow the toggles", () => {+ const { regions } = W.parseScanReport(REPORT)!;+ expect(W.regionAt(regions, 800, 100)?.chip).toBe("Logo");+ expect(W.regionAt(regions, 500, 500)).toBeNull();+ expect(W.regionAt(regions, 500, 585, 10)?.chip).toBe("Text");+ const overlapping = [...regions, { ...regions[0], id: "big", box: [0, 0, 1000, 800] as [number, number, number, number] }];+ expect(W.regionAt(overlapping, 800, 100)?.chip).toBe("Logo");+ expect(W.foundLine(3)).toBe("Found 3. Tap any you want to keep.");+ expect(W.removeLabel(3)).toBe("Remove 3");+ expect(W.removeLabel(0)).toBe("Everything is kept");+ const sent = JSON.parse(W.keptBoxesJson(regions.map((r) => (r.chip === "Logo" ? { ...r, on: false } : r))));+ expect(sent.coordinate_space).toBe("pixels");+ expect(sent.boxes.map((b: { overlay_type: string }) => b.overlay_type)).toEqual(["translucent_text_logo", "irregular_sticker"]);+ expect(sent.boxes[0]).toMatchObject({ bbox: [80, 560, 920, 700], source_bbox: [120, 590, 880, 670] });+ expect(() => W.checkWatermarkBoxes(W.keptBoxesJson(regions))).not.toThrow();+ });+});++describe("11. the repair's verdict and the Library", () => {+ it("folds QWMFinal's report into the picture's meta, never a result of its own", () => {+ const outs = collectOutputs(+ {+ outputs: {+ "33": { images: [{ filename: "w_00001_.png", subfolder: "fuobe", type: "output" }] },+ "38": { text: [JSON.stringify({ status: "needs_review", selected_pass: 2, outside_mask_max_difference: 0, needs_review: true, reasons: ["residual_unverified"], first_pass_quality: { big: 1 } })] },+ },+ } as never,+ entry(REMOVE),+ );+ expect(outs).toHaveLength(1);+ expect(outs[0].kind).toBe("image");+ expect(outs[0].meta?.quality).toEqual({ status: "needs_review", selectedPass: 2, outsideMaskMaxDifference: 0, needsReview: true, reasons: ["residual_unverified"] });+ expect(W.rejectedRepair(W.qualityOf(JSON.stringify({ status: "rejected_first_pass" })))).toBe(true);+ expect(W.rejectedRepair(W.qualityOf(JSON.stringify({ status: "completed_clean_first_pass" })))).toBe(false);+ });++ it("keeps the scans out of the Library", () => {+ expect(HELPER_FEATURES).toContain(W.WATERMARK_SCAN_FEATURE);+ expect(isHelperFeature(W.WATERMARK_SCAN_FEATURE)).toBe(true);+ expect(isHelperFeature(W.WATERMARK_FEATURE)).toBe(false);+ });+});++describe("12. licences", () => {+ it("lists the pack as MIT and the graphs with the Qwen-Image 2.1 terms", () => {+ expect(nodePack("ComfyUI-Qwen-Watermark")?.licence).toMatchObject({ name: "MIT", class: "commercial" });+ expect(nodePack("ComfyUI-Qwen-Watermark")?.repo).toBe(`https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/${PIN}`);+ expect(entry(REMOVE).license).toMatch(/^Qwen Research License Agreement \(Qwen-Image 2\.1\): NON-COMMERCIAL.*SAM ViT-B \(segment-anything\) Apache-2\.0; ComfyUI-Qwen-Watermark nodes MIT$/);+ expect(entry(SCAN).license).toBe("Qwen3-VL 8B Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT");+ expect(workflowLicence(entry(REMOVE))).toBeTruthy();+ const list = buildLicenceList(MODELS, manifest.workflows);+ expect(JSON.stringify(list)).toContain("Watermark Remover");+ expect(read("CREDITS.md")).toContain("ComfyUI-Qwen-Watermark");+ });+});++describe("13. the Library action", () => {+ const gen = (o: Partial<Generation>, kind: "image" = "image", url = "/api/files/out/x.png"): Generation =>+ ({ id: "g1", status: "succeeded", feature: "image", op: "t2i", provider: "comfyui", outputs: [{ url, kind }], request: {}, createdAt: "", ...o }) as unknown as Generation;+ const has = (g: Generation) => outputActions(g, 0).find((a) => a.id === "remove-watermark");+ it("is on pictures, opens the app with the picture, and isn't on vectors or the app's own results", () => {+ expect(has(gen({}))).toMatchObject({ label: "Remove watermark", placement: "menu", href: "/apps/app-watermark-remover?image=%2Fapi%2Ffiles%2Fout%2Fx.png" });+ expect(has(gen({ op: "vectorize" }, "image", "/api/files/out/x.svg"))).toBeUndefined();+ expect(has(gen({ feature: W.WATERMARK_FEATURE }))).toBeUndefined();+ });+});++describe("14. search and the Edit studio", () => {+ it("finds the app by its words and links it from Edit", () => {+ expect(APP_KEYWORDS["app-watermark-remover"]).toMatch(/watermark.*logo.*caption.*mosaic/);+ expect(EDIT_STUDIO.related).toEqual({ href: "/apps/app-watermark-remover", label: "Remove watermarks, captions and logos automatically" });+ });+});++describe("15. the demo", () => {+ it("the scan finds two marks sized to the picture, and the removal gives the picture back", { timeout: 60_000 }, async () => {+ const report = JSON.parse(demoWatermarkReport(`data:image/png;base64,${png(400, 300).toString("base64")}`));+ expect(report.image_size).toEqual([400, 300]);+ expect(report.boxes).toHaveLength(2);+ expect(W.parseScanReport(JSON.stringify(report))!.regions.map((r) => r.chip)).toEqual(["Text", "Logo"]);+ expect(mockProvider.id).toBe("mock");++ ensureRunner();+ const picture = saveFile({ data: png(64, 48), contentType: "image/png", source: "upload" });+ const [scan] = createGenerations({ feature: W.WATERMARK_SCAN_FEATURE, modelId: "oss-watermark-scan", op: "watermark-scan", inputs: { images: [picture.url] } });+ const s = await settled(scan.id);+ expect(s.status).toBe("succeeded");+ const parsed = W.parseScanReport(s.outputs.find((o) => o.kind === "text")?.text)!;+ expect([parsed.width, parsed.height]).toEqual([64, 48]);+ const [removal] = createGenerations({+ feature: W.WATERMARK_FEATURE,+ presetId: "app-watermark-remover",+ modelId: "oss-watermark-remover",+ op: "watermark-remove",+ inputs: { images: [picture.url] },+ params: { extra: { boxes: W.keptBoxesJson(parsed.regions) } },+ });+ const r = await settled(removal.id);+ expect(r.status).toBe("succeeded");+ expect(r.outputs[0].kind).toBe("image");+ });+});++describe("16. visitor words", () => {+ it("never name models, masks, nodes, graphs or internal status", () => {+ const BANNED = /\b(model|mask|node|graph|LoRA|SAM|Qwen|seed|confidence|review|needs_review|VLM)\b/i;+ const visitor = [W.COPY.name, W.COPY.tagline, W.COPY.hero, W.COPY.subline, ...W.COPY.details, W.COPY.scanning, W.COPY.removing, W.COPY.empty, W.COPY.rejected, W.COPY.tooBig, W.COPY.noneKept, W.COPY.hint];+ for (const s of visitor) expect(s, s).not.toMatch(BANNED);+ const app = APPS.find((a) => a.id === "app-watermark-remover")!;+ for (const s of [app.name, app.description, app.parity ?? ""]) expect(s, s).not.toMatch(BANNED);+ // The page's own strings (JSX text and string literals), past the owner-only row.+ for (const f of ["watermark-tool.tsx", "regions.tsx", "flip-compare.tsx"]) {+ const src = read(`src/components/watermark/${f}`)+ .replace(/\/\*[\s\S]*?\*\//g, "")+ .replace(/\/\/.*$/gm, "")+ .replace(/\{owner && quality[\s\S]*?<\/p>\s*\)\}/, "");+ const texts = [...src.matchAll(/>([^<>{}]+)</g)].map((m) => m[1].trim()).filter(Boolean);+ const quoted = [...src.matchAll(/"([A-Z][^"]{3,})"/g)].map((m) => m[1]);+ for (const t of [...texts, ...quoted]) expect(t, `${f}: ${t}`).not.toMatch(BANNED);+ }+ });+});++const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));+async function settled(id: string, ms = 30_000) {+ const end = Date.now() + ms;+ for (;;) {+ const g = getGeneration(id)!;+ if (["succeeded", "failed", "canceled"].includes(g.status)) return g;+ if (Date.now() > end) throw new Error(`${id} is still ${g.status}`);+ await sleep(50);+ }+}diff --git a/workflows/comfyui/image-watermark-remove-qwen21-brush.json b/workflows/comfyui/image-watermark-remove-qwen21-brush.jsonnew file mode 100644index 00000000..6473851b--- /dev/null+++ b/workflows/comfyui/image-watermark-remove-qwen21-brush.json@@ -0,0 +1,442 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "manual_mask",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "50",+ 0+ ],+ "min_confidence": 0.65+ }+ },+ "4": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "3",+ 0+ ],+ "boxes_json": [+ "3",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 12,+ "adaptive_dilation": true+ }+ },+ "5": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "context_pixels": 96,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 5,+ "edit_prompt": [+ "3",+ 3+ ],+ "boxes_json": [+ "3",+ 1+ ]+ }+ },+ "6": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ }+ },+ "7": {+ "class_type": "ModelAttentionBackend",+ "inputs": {+ "model": [+ "6",+ 0+ ],+ "attention": "comfy kitchen attention"+ }+ },+ "8": {+ "class_type": "QwenImage21Cache",+ "inputs": {+ "model": [+ "7",+ 0+ ],+ "device": "off",+ "dtype": "default"+ }+ },+ "9": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ }+ },+ "10": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "5",+ 0+ ],+ "prompt": [+ "5",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,残留动物或人物,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "12": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "10",+ 0+ ],+ "negative": [+ "10",+ 1+ ],+ "latent_image": [+ "10",+ 2+ ],+ "seed": 802146,+ "steps": 20,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "13": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "12",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "14": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "edited_crop": [+ "13",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "geometry": [+ "5",+ 2+ ],+ "feather": 6,+ "align": true,+ "color_match": true+ }+ },+ "26": {+ "class_type": "QWMResidualDetect",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "detection_side": 1024,+ "expand": 24,+ "max_tokens": 384,+ "edit_prompt": "",+ "allowed_mask": [+ "4",+ 0+ ],+ "enabled": true,+ "min_confidence": 0.8,+ "first_report": [+ "14",+ 2+ ],+ "original_image": [+ "1",+ 0+ ]+ }+ },+ "27": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "26",+ 0+ ],+ "boxes_json": [+ "26",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 8,+ "adaptive_dilation": false+ }+ },+ "28": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "context_pixels": 128,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 3,+ "edit_prompt": [+ "26",+ 3+ ],+ "boxes_json": [+ "26",+ 1+ ]+ }+ },+ "29": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "28",+ 0+ ],+ "prompt": [+ "28",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,重影,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "30": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "29",+ 0+ ],+ "negative": [+ "29",+ 1+ ],+ "latent_image": [+ "29",+ 2+ ],+ "seed": 240517,+ "steps": 16,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "31": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "30",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "32": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "14",+ 0+ ],+ "edited_crop": [+ "31",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "geometry": [+ "28",+ 2+ ],+ "feather": 4,+ "align": true,+ "color_match": true+ }+ },+ "33": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "37",+ 0+ ],+ "filename_prefix": "fuobe/image-watermark-remove-qwen21-brush"+ }+ },+ "37": {+ "class_type": "QWMFinal",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "initial_mask": [+ "4",+ 0+ ],+ "detection_report": [+ "3",+ 1+ ],+ "first_pass": [+ "14",+ 0+ ],+ "first_report": [+ "14",+ 2+ ],+ "residual_report": [+ "26",+ 1+ ],+ "second_pass": [+ "32",+ 0+ ],+ "second_report": [+ "32",+ 2+ ],+ "residual_mask": [+ "27",+ 0+ ]+ }+ },+ "38": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "37",+ 2+ ]+ }+ },+ "50": {+ "class_type": "LoadImageMask",+ "inputs": {+ "image": "example_mask.png",+ "channel": "red"+ }+ }+}diff --git a/workflows/comfyui/image-watermark-remove-qwen21.json b/workflows/comfyui/image-watermark-remove-qwen21.jsonnew file mode 100644index 00000000..91936c13--- /dev/null+++ b/workflows/comfyui/image-watermark-remove-qwen21.json@@ -0,0 +1,435 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "auto_qwen",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "1",+ 1+ ],+ "min_confidence": 0.65+ }+ },+ "4": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "3",+ 0+ ],+ "boxes_json": [+ "3",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 12,+ "adaptive_dilation": true+ }+ },+ "5": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "context_pixels": 96,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 5,+ "edit_prompt": [+ "3",+ 3+ ],+ "boxes_json": [+ "3",+ 1+ ]+ }+ },+ "6": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ }+ },+ "7": {+ "class_type": "ModelAttentionBackend",+ "inputs": {+ "model": [+ "6",+ 0+ ],+ "attention": "comfy kitchen attention"+ }+ },+ "8": {+ "class_type": "QwenImage21Cache",+ "inputs": {+ "model": [+ "7",+ 0+ ],+ "device": "off",+ "dtype": "default"+ }+ },+ "9": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ }+ },+ "10": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "5",+ 0+ ],+ "prompt": [+ "5",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,残留动物或人物,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "12": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "10",+ 0+ ],+ "negative": [+ "10",+ 1+ ],+ "latent_image": [+ "10",+ 2+ ],+ "seed": 802146,+ "steps": 20,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "13": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "12",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "14": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "edited_crop": [+ "13",+ 0+ ],+ "mask": [+ "4",+ 0+ ],+ "geometry": [+ "5",+ 2+ ],+ "feather": 6,+ "align": true,+ "color_match": true+ }+ },+ "26": {+ "class_type": "QWMResidualDetect",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "detection_side": 1024,+ "expand": 24,+ "max_tokens": 384,+ "edit_prompt": "",+ "allowed_mask": [+ "4",+ 0+ ],+ "enabled": true,+ "min_confidence": 0.8,+ "first_report": [+ "14",+ 2+ ],+ "original_image": [+ "1",+ 0+ ]+ }+ },+ "27": {+ "class_type": "QWMRefineMask",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "26",+ 0+ ],+ "boxes_json": [+ "26",+ 1+ ],+ "method": "auto",+ "sam_model": "sam_vit_b_01ec64.pth",+ "device": "auto",+ "dilation": 8,+ "adaptive_dilation": false+ }+ },+ "28": {+ "class_type": "QWMPrepare",+ "inputs": {+ "image": [+ "14",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "context_pixels": 128,+ "max_side": 1024,+ "pre_inpaint": "auto",+ "inpaint_radius": 3,+ "edit_prompt": [+ "26",+ 3+ ],+ "boxes_json": [+ "26",+ 1+ ]+ }+ },+ "29": {+ "class_type": "TextEncodeQwenImage21",+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "9",+ 0+ ],+ "images.image_1": [+ "28",+ 0+ ],+ "prompt": [+ "28",+ 4+ ],+ "negative_prompt": "残留水印,残留贴纸,重影,模糊涂抹,接缝,构图变化,物体移位",+ "resolution": 0+ }+ },+ "30": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "8",+ 0+ ],+ "positive": [+ "29",+ 0+ ],+ "negative": [+ "29",+ 1+ ],+ "latent_image": [+ "29",+ 2+ ],+ "seed": 240517,+ "steps": 16,+ "cfg": 1,+ "sampler_name": "euler_ancestral",+ "scheduler": "sgm_uniform",+ "denoise": 1+ }+ },+ "31": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "30",+ 0+ ],+ "vae": [+ "9",+ 0+ ]+ }+ },+ "32": {+ "class_type": "QWMComposite",+ "inputs": {+ "original": [+ "14",+ 0+ ],+ "edited_crop": [+ "31",+ 0+ ],+ "mask": [+ "27",+ 0+ ],+ "geometry": [+ "28",+ 2+ ],+ "feather": 4,+ "align": true,+ "color_match": true+ }+ },+ "33": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "37",+ 0+ ],+ "filename_prefix": "fuobe/image-watermark-remove-qwen21"+ }+ },+ "37": {+ "class_type": "QWMFinal",+ "inputs": {+ "original": [+ "1",+ 0+ ],+ "initial_mask": [+ "4",+ 0+ ],+ "detection_report": [+ "3",+ 1+ ],+ "first_pass": [+ "14",+ 0+ ],+ "first_report": [+ "14",+ 2+ ],+ "residual_report": [+ "26",+ 1+ ],+ "second_pass": [+ "32",+ 0+ ],+ "second_report": [+ "32",+ 2+ ],+ "residual_mask": [+ "27",+ 0+ ]+ }+ },+ "38": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "37",+ 2+ ]+ }+ }+}diff --git a/workflows/comfyui/image-watermark-scan-qwen3vl.json b/workflows/comfyui/image-watermark-scan-qwen3vl.jsonnew file mode 100644index 00000000..0cba1985--- /dev/null+++ b/workflows/comfyui/image-watermark-scan-qwen3vl.json@@ -0,0 +1,51 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "example.png"+ }+ },+ "2": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ }+ },+ "3": {+ "class_type": "QWMDetect",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "clip": [+ "2",+ 0+ ],+ "mode": "auto_qwen",+ "boxes_json": "{\"coordinate_space\":\"pixels\",\"boxes\":[]}",+ "detection_side": 1024,+ "expand": 20,+ "max_tokens": 512,+ "hint": "",+ "edit_prompt": "",+ "padding_ratio": 0.35,+ "manual_mask": [+ "1",+ 1+ ],+ "min_confidence": 0.65+ }+ },+ "23": {+ "class_type": "PreviewAny",+ "inputs": {+ "source": [+ "3",+ 1+ ]+ }+ }+}diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.jsonindex d1b4b9da..7b3bebd5 100644--- a/workflows/comfyui/manifest.json+++ b/workflows/comfyui/manifest.json@@ -10850,6 +10850,259 @@"validated": true,"notes": "Fuobe Soul's PixeletedFace look: SAM3_Detect with the words (prompt, \"face\" by default: every face, one merged mask, threshold 0.4), GrowMask 12 px so the hair line and jaw are covered, then the picture shrunk by mosaicScale with area averaging (0.04: blocks of 25 px) and blown back up with nearest-exact to its own size, composited only under the mask (ImageCompositeMasked). No face found: the picture comes back unchanged. Core nodes and the SAM 3.1 checkpoint only."},+ {+ "id": "image-watermark-scan-qwen3vl",+ "title": "Find watermarks, captions, logos, stickers and mosaics on a photo (Qwen3-VL, ComfyUI-Qwen-Watermark)",+ "capability": "watermark-scan",+ "file": "image-watermark-scan-qwen3vl.json",+ "source": "hand-built (scripts/comfy/hand-built/image-watermark-scan-qwen3vl.json)",+ "bindings": {+ "image": [+ {+ "node": "1",+ "input": "image"+ }+ ]+ },+ "outputs": [+ {+ "node": "23",+ "kind": "text",+ "role": "report"+ }+ ],+ "defaults": {},+ "limits": {+ "maxWidth": 4096,+ "maxHeight": 4096+ },+ "models": [+ {+ "file": "qwen3vl_8b_int8_convrot.safetensors",+ "folder": "text_encoders",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors",+ "sizeGb": 9.35+ }+ ],+ "customNodes": [+ {+ "name": "ComfyUI-Qwen-Watermark",+ "repo": "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34"+ }+ ],+ "vramGb": 10,+ "license": "Qwen3-VL 8B Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT",+ "validated": false,+ "notes": "The pack's detect-only workflow (qwen_watermark_detection.api.json) without its preview and save nodes: QWMDetect auto_qwen reads the picture once with Qwen3-VL 8B (int8, detection side 1024, expand 20, padding 0.35, min confidence 0.65) and PreviewAny shows its report, the only output: JSON {coordinate_space: \"pixels\", image_size, boxes: [{label, bbox (padded repair box), source_bbox (tight), overlay_type, mask_method, confidence}], rejected_boxes (below 0.65), status}. The app draws source_bbox and sends the kept boxes to image-watermark-remove-qwen21. The GPU pre-flight also checks image-watermark-remove-qwen21 for a scan (its companion graph)."+ },+ {+ "id": "image-watermark-remove-qwen21",+ "title": "Remove watermarks, captions, logos, stickers and mosaics, the rest unchanged (Qwen-Image 2.1, ComfyUI-Qwen-Watermark)",+ "capability": "watermark-remove",+ "file": "image-watermark-remove-qwen21.json",+ "source": "hand-built (scripts/comfy/hand-built/image-watermark-remove-qwen21.json)",+ "bindings": {+ "image": [+ {+ "node": "1",+ "input": "image"+ }+ ],+ "seed": [+ {+ "node": "12",+ "input": "seed"+ },+ {+ "node": "30",+ "input": "seed"+ }+ ],+ "detectMode": [+ {+ "node": "3",+ "input": "mode"+ }+ ],+ "boxes": [+ {+ "node": "3",+ "input": "boxes_json"+ }+ ],+ "maxSize": [+ {+ "node": "5",+ "input": "max_side"+ },+ {+ "node": "28",+ "input": "max_side"+ }+ ],+ "filenamePrefix": [+ {+ "node": "33",+ "input": "filename_prefix"+ }+ ]+ },+ "outputs": [+ {+ "node": "33",+ "kind": "image"+ },+ {+ "node": "38",+ "kind": "text",+ "role": "quality"+ }+ ],+ "defaults": {+ "maxSize": 1024+ },+ "limits": {+ "maxWidth": 4096,+ "maxHeight": 4096+ },+ "models": [+ {+ "file": "qwen3vl_8b_int8_convrot.safetensors",+ "folder": "text_encoders",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors",+ "sizeGb": 9.35+ },+ {+ "file": "sam_vit_b_01ec64.pth",+ "folder": "sams",+ "url": "https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth",+ "sizeGb": 0.38+ },+ {+ "file": "qwen_image_2.1_int8_convrot.safetensors",+ "folder": "diffusion_models",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors",+ "sizeGb": 7.26+ },+ {+ "file": "qwen_image_2.1_vae_bf16.safetensors",+ "folder": "vae",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors",+ "sizeGb": 0.68+ }+ ],+ "customNodes": [+ {+ "name": "ComfyUI-Qwen-Watermark",+ "repo": "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34"+ }+ ],+ "vramGb": 20,+ "license": "Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT",+ "validated": false,+ "notes": "The pack's main workflow (qwen21_watermark.api.json, plain settings) with the int8 UNET (qwen_image_2.1_int8_convrot, as Live edit) and without its debug save and preview nodes. QWMDetect (manual_boxes with the kept boxes, auto_qwen for API callers) -> QWMRefineMask (a rectangle for text, logos, blocks and mosaics, a SAM ViT-B outline for stickers) -> QWMPrepare (context 96, max side maxSize, OpenCV pre-fill) -> Qwen-Image 2.1 edit, 20 steps, cfg 1 -> QWMComposite (feather 6, align, colour match) -> QWMResidualDetect (Qwen3-VL looks for leftovers inside the first mask) -> one more pass when it finds some -> QWMFinal keeps the better pass and raises when any pixel outside the mask changed. Outputs: the picture (SaveImage, PNG) and the quality report (PreviewAny, role quality: folded into the picture's meta, never a result of its own). Seeds are random per run. The structure settings (denoise 0.65 / 0.55, context 384, no pre-fill) are the pack's alternative for faces; the GPU test decides between them."+ },+ {+ "id": "image-watermark-remove-qwen21-brush",+ "title": "Remove what was brushed, the rest unchanged (Qwen-Image 2.1, ComfyUI-Qwen-Watermark)",+ "capability": "watermark-remove",+ "file": "image-watermark-remove-qwen21-brush.json",+ "source": "hand-built (scripts/comfy/hand-built/image-watermark-remove-qwen21-brush.json)",+ "bindings": {+ "image": [+ {+ "node": "1",+ "input": "image"+ }+ ],+ "mask": [+ {+ "node": "50",+ "input": "image"+ }+ ],+ "seed": [+ {+ "node": "12",+ "input": "seed"+ },+ {+ "node": "30",+ "input": "seed"+ }+ ],+ "maxSize": [+ {+ "node": "5",+ "input": "max_side"+ },+ {+ "node": "28",+ "input": "max_side"+ }+ ],+ "filenamePrefix": [+ {+ "node": "33",+ "input": "filename_prefix"+ }+ ]+ },+ "outputs": [+ {+ "node": "33",+ "kind": "image"+ },+ {+ "node": "38",+ "kind": "text",+ "role": "quality"+ }+ ],+ "defaults": {+ "maxSize": 1024+ },+ "limits": {+ "maxWidth": 4096,+ "maxHeight": 4096+ },+ "models": [+ {+ "file": "qwen3vl_8b_int8_convrot.safetensors",+ "folder": "text_encoders",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors",+ "sizeGb": 9.35+ },+ {+ "file": "sam_vit_b_01ec64.pth",+ "folder": "sams",+ "url": "https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth",+ "sizeGb": 0.38+ },+ {+ "file": "qwen_image_2.1_int8_convrot.safetensors",+ "folder": "diffusion_models",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors",+ "sizeGb": 7.26+ },+ {+ "file": "qwen_image_2.1_vae_bf16.safetensors",+ "folder": "vae",+ "url": "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors",+ "sizeGb": 0.68+ }+ ],+ "customNodes": [+ {+ "name": "ComfyUI-Qwen-Watermark",+ "repo": "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark/tree/eef829d34d6e9d0d2ae0c1386fab7371a864cf34"+ }+ ],+ "vramGb": 20,+ "license": "Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; Qwen3-VL 8B Apache-2.0; SAM ViT-B (segment-anything) Apache-2.0; ComfyUI-Qwen-Watermark nodes MIT",+ "validated": false,+ "notes": "image-watermark-remove-qwen21 with a painted mask: LoadImageMask (red channel, white = remove, the picture's size) into QWMDetect manual_mask. The provider runs it when the request carries a mask, on the latest result."+ },{"id": "palette-transfer-image","title": "Palette Lock (ColorTransfer to a swatch)",diff --git a/workflows/comfyui/model-pins.json b/workflows/comfyui/model-pins.jsonindex 1fe0f8ce..385f499a 100644--- a/workflows/comfyui/model-pins.json+++ b/workflows/comfyui/model-pins.json@@ -4,6 +4,11 @@"sizeBytes": 638987136,"sha256": "85578cd0b41dfac3fad1845be2755971367deee5348a692feb589a09d120ea8c"},+ "https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth": {+ "revision": "7790786db131bcdc639f24a915d9f2c331d843ee",+ "sizeBytes": 375042383,+ "sha256": "ec2df62732614e57411cdcf32a23ffdf28910380d03139ee0f4fcbe91eb8c912"+ },"https://huggingface.co/ATH-MaaS/OvisOCR3/resolve/main/model.safetensors": {"revision": "4833d5d2afa6e769ee933f024504d67ace80a24c","sizeBytes": 1706030528,diff --git a/workflows/comfyui/packs.json b/workflows/comfyui/packs.jsonindex 3b4b8c1d..d8885429 100644--- a/workflows/comfyui/packs.json+++ b/workflows/comfyui/packs.json@@ -387,5 +387,15 @@"isolated": false,"subdir": null,"folders": []+ },+ "ComfyUI-Qwen-Watermark": {+ "repo": "https://github.com/overflowofedge/ComfyUI-Qwen-Watermark",+ "commit": "eef829d34d6e9d0d2ae0c1386fab7371a864cf34",+ "registry": null,+ "requirementsTxt": false,+ "pip": ["segment-anything==1.0"],+ "isolated": false,+ "subdir": null,+ "folders": ["sams"]}}diff --git a/workflows/comfyui/requirements.json b/workflows/comfyui/requirements.jsonindex db71c835..4cd6c094 100644--- a/workflows/comfyui/requirements.json+++ b/workflows/comfyui/requirements.json@@ -1,9 +1,9 @@{"v": 1,- "hash": "e4952cc83ec3bd1d85076e85f4879f748688d86fe2fa4fdc630accc84eaf6226",+ "hash": "c9059f92fe47c41dfb1b7d7eca6d04f107f0efac575ee3d74fc1d13a5aa84db9","comfyui": {"min":"0.42.0","testedCommit":"5841c187"},- "folders": ["audio_encoders","background_removal","checkpoints","clip_vision","dbs","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","text_encoders","thinksound","upscale_models","vae"],- "sentinels": ["AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_MaskByTouch","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3AdvancedSwapPlan","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3ClipShots","H3FaceChunks","H3FaceJoin","H3FaceMaskSAM","H3FaceStitch","H3FaceTrackCrop","H3FillShots","H3GreyMannequins","H3ObjectSwapPlan","H3PeopleMask","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3RoleMask","H3SLAAttention","H3SoundtrackOrSilence","H3SourceSlice","H3SubjectPrompt","H3TrackCrops","H3TrackRoles","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageDetailContrast","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","Metric3D-NormalMapPreprocessor","MiniMaxH3ChainAssemble","MiniMaxH3ChainContext","MiniMaxH3ChainCurrent","MiniMaxH3ChainLoopEnd","MiniMaxH3ChainLoopStart","MiniMaxH3ChainPlanModern","MiniMaxH3ChainReview","MiniMaxH3ChainSegmentSave","MiniMaxH3ContexMaskedTarget","MiniMaxH3FantasticVideoEditLatent","MiniMaxH3GenerationProfile","MiniMaxH3LoopTrim","MiniMaxH3SourceTimeline","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","Orion4D_FXMax_DCTLToneMapper","PasteBackFuobeLive","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SAMLoader","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","SolarRendererConditioning","SolarRendererLoraLoader","SolarRendererModel","SolarRendererSigmas","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VRAM_Debug","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","ViggleTurboLora","ViggleTurboSigmas","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],+ "folders": ["audio_encoders","background_removal","checkpoints","clip_vision","dbs","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","sams","text_encoders","thinksound","upscale_models","vae"],+ "sentinels": ["AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_MaskByTouch","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3AdvancedSwapPlan","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3ClipShots","H3FaceChunks","H3FaceJoin","H3FaceMaskSAM","H3FaceStitch","H3FaceTrackCrop","H3FillShots","H3GreyMannequins","H3ObjectSwapPlan","H3PeopleMask","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3RoleMask","H3SLAAttention","H3SoundtrackOrSilence","H3SourceSlice","H3SubjectPrompt","H3TrackCrops","H3TrackRoles","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageDetailContrast","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","Metric3D-NormalMapPreprocessor","MiniMaxH3ChainAssemble","MiniMaxH3ChainContext","MiniMaxH3ChainCurrent","MiniMaxH3ChainLoopEnd","MiniMaxH3ChainLoopStart","MiniMaxH3ChainPlanModern","MiniMaxH3ChainReview","MiniMaxH3ChainSegmentSave","MiniMaxH3ContexMaskedTarget","MiniMaxH3FantasticVideoEditLatent","MiniMaxH3GenerationProfile","MiniMaxH3LoopTrim","MiniMaxH3SourceTimeline","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","Orion4D_FXMax_DCTLToneMapper","PasteBackFuobeLive","QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SAMLoader","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","SolarRendererConditioning","SolarRendererLoraLoader","SolarRendererModel","SolarRendererSigmas","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VRAM_Debug","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","ViggleTurboLora","ViggleTurboSigmas","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],"packs": {"ComfyUI-DBS": {"repo":"https://github.com/hiroki-abe-58/ComfyUI-DBS","commit":"f656e53434b5485c148a2866fbd6ddc6b6152ed6","registry":{"id":"dbs-soundtrack-separation","version":""},"classes":["DBSLoader","DBSSeparate"],"folders":["dbs"],"isolated":false,"requirementsTxt":true,"install":"manual"},"ComfyUI-Fantastic-MiniMaxH3-PromptBuilder": {"repo":"https://github.com/Adudeguyman/ComfyUI-Fantastic-MiniMaxH3-PromptBuilder","commit":"22e719fe89336c628383363182a4da3cb58d4f9b","classes":["MiniMaxH3FantasticVideoEditLatent"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},@@ -21,6 +21,7 @@"ComfyUI-MiniMax-H3-Turbo": {"repo":"https://github.com/Larryvrh/ComfyUI-MiniMax-H3-Turbo","commit":"77bfa67575b14e3be6214f1747732e540c68b5dd","registry":{"id":"comfyui-minimax-h3-turbo","version":""},"classes":["MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},"ComfyUI-MiniMaxH3-Context-Loop": {"repo":"https://github.com/ethanfel/ComfyUI-MiniMaxH3-Context-Loop","commit":"43afeffcc570beb5f7382593e79e4b211c7e02f6","classes":["MiniMaxH3ChainAssemble","MiniMaxH3ChainContext","MiniMaxH3ChainCurrent","MiniMaxH3ChainLoopEnd","MiniMaxH3ChainLoopStart","MiniMaxH3ChainPlanModern","MiniMaxH3ChainReview","MiniMaxH3ChainSegmentSave","MiniMaxH3ContexMaskedTarget","MiniMaxH3GenerationProfile","MiniMaxH3LoopTrim","MiniMaxH3SourceTimeline"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},"ComfyUI-Open-H3-Regenerate": {"repo":"https://github.com/rdh9616/ComfyUI-Open-H3-Regenerate","commit":"9b686c5ffd380e9d1351f9b8beef6d20d703ca3e","classes":["OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},+ "ComfyUI-Qwen-Watermark": {"repo":"https://github.com/overflowofedge/ComfyUI-Qwen-Watermark","commit":"eef829d34d6e9d0d2ae0c1386fab7371a864cf34","classes":["QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect"],"folders":["sams"],"isolated":false,"requirementsTxt":false,"pip":["segment-anything==1.0"],"install":"manual"},"ComfyUI-QwenASR": {"repo":"https://github.com/1038lab/ComfyUI-QwenASR","commit":"3f9a652a617e578e4e3bd090e3dbc75274bf4775","registry":{"id":"ComfyUI-QwenASR","version":""},"classes":["AILab_Qwen3ASRSubtitle"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},"ComfyUI-QwenTTS": {"repo":"https://github.com/1038lab/ComfyUI-QwenTTS","commit":"d8122a8ba835b65fd65c113d2b273b1ad1579293","registry":{"id":"ComfyUI-QwenTTS","version":""},"classes":["AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},"ComfyUI-RE-USE": {"repo":"https://github.com/workingprototype/Fuobe","commit":"8cc0417b5cb8a603f06502d97d5c6d8c6035ea0d","classes":["REUSEEnhance","REUSELoader"],"folders":["reuse"],"isolated":false,"subdir":"comfy-nodes/ComfyUI-RE-USE","requirementsTxt":false,"install":"manual"},@@ -217,6 +218,7 @@"optical_flow/raft_large_C_T_SKHT_V2-ff5fadd5.safetensors": {"folder":"optical_flow","file":"raft_large_C_T_SKHT_V2-ff5fadd5.safetensors","url":"https://huggingface.co/Comfy-Org/void-model/resolve/main/optical_flow/raft_large_C_T_SKHT_V2-ff5fadd5.safetensors","pinnedUrl":"https://huggingface.co/Comfy-Org/void-model/resolve/f9c9e565920002478ab9477f4c99c29c52d16db3/optical_flow/raft_large_C_T_SKHT_V2-ff5fadd5.safetensors","sizeBytes":21060840,"gated":false,"presence":"loader","loaders":[["OpticalFlowLoader","model_name"]]},"reuse/NemotronLabs-RE-USE-laughter.safetensors": {"folder":"reuse","file":"NemotronLabs-RE-USE-laughter.safetensors","url":"https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE-laughter/resolve/1b1521dd659608e1e063ada83e0acfe1da473a8b/model.safetensors","pinnedUrl":"https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE-laughter/resolve/1b1521dd659608e1e063ada83e0acfe1da473a8b/model.safetensors","sizeBytes":38592940,"gated":false,"packFolder":"ComfyUI-RE-USE","presence":"list"},"reuse/NemotronLabs-RE-USE.safetensors": {"folder":"reuse","file":"NemotronLabs-RE-USE.safetensors","url":"https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE/resolve/31f82f2efad1095034492f236e8dac9239ba713b/model.safetensors","pinnedUrl":"https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE/resolve/31f82f2efad1095034492f236e8dac9239ba713b/model.safetensors","sizeBytes":38592940,"gated":false,"packFolder":"ComfyUI-RE-USE","presence":"loader","loaders":[["REUSELoader","model"]]},+ "sams/sam_vit_b_01ec64.pth": {"folder":"sams","file":"sam_vit_b_01ec64.pth","url":"https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth","pinnedUrl":"https://huggingface.co/ybelkada/segment-anything/resolve/7790786db131bcdc639f24a915d9f2c331d843ee/checkpoints/sam_vit_b_01ec64.pth","sizeBytes":375042383,"sha256":"ec2df62732614e57411cdcf32a23ffdf28910380d03139ee0f4fcbe91eb8c912","gated":false,"packFolder":"ComfyUI-Qwen-Watermark","presence":"unobservable"},"text_encoders/adapter_v12.safetensors": {"folder":"text_encoders","file":"adapter_v12.safetensors","url":"https://github.com/recoilme/zen-image-edit-comfyui/releases/download/v2/adapter_v12.safetensors","pinnedUrl":"https://github.com/recoilme/zen-image-edit-comfyui/releases/download/v2/adapter_v12.safetensors","sizeBytes":638987136,"sha256":"85578cd0b41dfac3fad1845be2755971367deee5348a692feb589a09d120ea8c","gated":false,"presence":"list"},"text_encoders/byt5_small_glyphxl_fp16.safetensors": {"folder":"text_encoders","file":"byt5_small_glyphxl_fp16.safetensors","url":"https://huggingface.co/Comfy-Org/HunyuanVideo_1.5_repackaged/resolve/main/split_files/text_encoders/byt5_small_glyphxl_fp16.safetensors","pinnedUrl":"https://huggingface.co/Comfy-Org/HunyuanVideo_1.5_repackaged/resolve/1405a2b738c29b890cf6d03fc038d8d3e92eeed7/split_files/text_encoders/byt5_small_glyphxl_fp16.safetensors","sizeBytes":438643184,"gated":false,"presence":"loader","loaders":[["DualCLIPLoader","clip_name2"]]},"text_encoders/clip_g_hidream.safetensors": {"folder":"text_encoders","file":"clip_g_hidream.safetensors","url":"https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/text_encoders/clip_g_hidream.safetensors","pinnedUrl":"https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/942970a008493fc9bf05b4827374009e69f6a993/split_files/text_encoders/clip_g_hidream.safetensors","sizeBytes":1389743104,"gated":false,"presence":"loader","loaders":[["QuadrupleCLIPLoader","clip_name2"]]},@@ -319,13 +321,15 @@"image-face-mosaic-sam3": {"core":["CLIPTextEncode","CheckpointLoaderSimple","GetImageSize","GrowMask","ImageCompositeMasked","ImageScale","ImageScaleBy","LoadImage","SAM3_Detect","SaveImage"],"packs":{},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors"],"optional":[],"vramGb":4,"isolated":false,"firstRun":[],"validated":true},"image-from-picture-prepare": {"core":["CLIPLoader","CLIPTextEncode","ConditioningZeroOut","ImageBatch","ImageFromBatch","ImageScale","ImageScaleToMaxDimension","KSampler","LoadImage","PrimitiveStringMultiline","ReferenceMultiLatent","SaveImage","TextGenerate","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_LoadVideo"]},"files":["diffusion_models/flux3-image-klein-int8-convrot.safetensors","text_encoders/qwen3.5_9b_flux3_prompt_upsampler_int8_convrot.safetensors","text_encoders/qwen3vl_4b_int8_convrot.safetensors","vae/flux2-vae.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[]},"image-to-3d-hunyuan3d-21": {"core":["CLIPVisionEncode","EmptyLatentHunyuan3Dv2","Hunyuan3Dv2Conditioning","ImageOnlyCheckpointLoader","KSampler","LoadImage","ModelSamplingAuraFlow","SaveGLB","VAEDecodeHunyuan3D","VoxelToMesh"],"packs":{},"files":["checkpoints/hunyuan_3d_v2.1.safetensors"],"optional":[],"vramGb":10,"isolated":false,"firstRun":[],"validated":true},- "image-to-3d-idol": {"core":["CLIPVisionLoader","ComfySwitchNode","CreateCameraInfo","CreateVideo","EmptyImage","ImageCompositeMasked","ImageScale","InvertMask","KSampler","LoadBackgroundRemovalModel","LoadImage","RemoveBackground","RenderSplat","SaveGLB","SaveImage","SaveVideo","SplatToFile3D","SplatToMesh","TripoSplatConditioning","TripoSplatPreprocessImage","UNETLoader","VAEDecodeTripoSplat","VAELoader"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_vit_h.safetensors","diffusion_models/idol_fp16.safetensors","vae/flux2-vae.safetensors","vae/idol_decoder_fp16.safetensors"],"optional":[],"vramGb":10,"isolated":false,"firstRun":[],"validated":true},"image-to-3d-pixal3d": {"core":["ApplyTextureToMesh","BakeAmbientOcclusion","BakeNormalMapFromMesh","BakeTextureFromVoxel","CFGOverride","CLIPVisionLoader","DecimateMesh","EmptyTrellis2LatentStructure","GetMeshInfo","ImageCropToMask","KSampler","LoadBackgroundRemovalModel","LoadImage","LoadMoGeModel","MeshSmoothNormals","MeshToFile3D","MoGeGeometryToFOV","MoGeInference","ModelSamplingSD3","Pixal3DConditioning","PrimitiveInt","RemeshMesh","RemoveBackground","RescaleCFG","Save3DAdvanced","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","UNETLoader","UnwrapMesh","VAELoader","VaeDecodeShapeTrellis","VaeDecodeStructureTrellis2","VaeDecodeTextureTrellis"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_L_naf_fp32.safetensors","diffusion_models/pixal3d_int8_convrot.safetensors","geometry_estimation/moge_2_vitl_normal_fp16.safetensors","vae/trellis_2_shape_vae_bf16.safetensors","vae/trellis_2_texture_vae_bf16.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[],"validated":true},"image-to-3d-trellis2": {"core":["ApplyTextureToMesh","BakeAmbientOcclusion","BakeNormalMapFromMesh","BakeTextureFromVoxel","CFGOverride","CLIPVisionLoader","DecimateMesh","EmptyTrellis2LatentStructure","GetMeshInfo","ImageCropToMask","KSampler","LoadBackgroundRemovalModel","LoadImage","MeshSmoothNormals","MeshToFile3D","ModelSamplingSD3","PrimitiveInt","RemeshMesh","RemoveBackground","RescaleCFG","Save3DAdvanced","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","UNETLoader","UnwrapMesh","VAELoader","VaeDecodeShapeTrellis","VaeDecodeStructureTrellis2","VaeDecodeTextureTrellis"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_L_naf_fp32.safetensors","diffusion_models/trellis_2_int8_convrot.safetensors","vae/trellis_2_shape_vae_bf16.safetensors","vae/trellis_2_texture_vae_bf16.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[],"validated":true},"image-to-3d-trellis2-multiview": {"core":["ApplyTextureToMesh","BakeAmbientOcclusion","BakeNormalMapFromMesh","BakeTextureFromVoxel","BatchImagesNode","CFGOverride","CLIPVisionLoader","CreateVideo","DecimateMesh","EmptyTrellis2LatentStructure","GetMeshInfo","ImageCropToMask","KSampler","LoadBackgroundRemovalModel","LoadImage","LoadMoGeModel","MeshSmoothNormals","MeshToFile3D","MoGeGeometryToFOV","MoGeInference","ModelSamplingSD3","Pixal3DMultiViewConditioning","PrimitiveInt","RemeshMesh","RemoveBackground","RenderMesh","RescaleCFG","RotateMesh","Save3DAdvanced","SaveVideo","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","UNETLoader","UnwrapMesh","VAELoader","VaeDecodeShapeTrellis","VaeDecodeStructureTrellis2","VaeDecodeTextureTrellis"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_L_naf_fp32.safetensors","diffusion_models/pixal3d_multiview_int8_convrot.safetensors","geometry_estimation/moge_2_vitl_normal_fp16.safetensors","vae/trellis_2_shape_vae_bf16.safetensors","vae/trellis_2_texture_vae_bf16.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[],"validated":true},"image-to-splat-idol": {"core":["CLIPVisionLoader","ComfySwitchNode","CreateCameraInfo","CreateVideo","EmptyImage","ImageCompositeMasked","ImageScale","InvertMask","KSampler","LoadBackgroundRemovalModel","LoadImage","RemoveBackground","RenderSplat","SaveGLB","SaveVideo","SplatToFile3D","TripoSplatConditioning","TripoSplatPreprocessImage","UNETLoader","VAEDecodeTripoSplat","VAELoader"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_vit_h.safetensors","diffusion_models/idol_fp16.safetensors","vae/flux2-vae.safetensors","vae/idol_decoder_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true},"image-to-splat-triposplat": {"core":["CLIPVisionLoader","ComfySwitchNode","CreateCameraInfo","CreateVideo","InvertMask","KSampler","LoadBackgroundRemovalModel","LoadImage","RemoveBackground","RenderSplat","SaveGLB","SaveVideo","SplatToFile3D","TripoSplatConditioning","TripoSplatPreprocessImage","UNETLoader","VAEDecodeTripoSplat","VAELoader"],"packs":{},"files":["background_removal/birefnet.safetensors","clip_vision/dino_v3_vit_h.safetensors","diffusion_models/triposplat_fp16.safetensors","vae/flux2-vae.safetensors","vae/triposplat_vae_decoder_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true},"image-vectorize-vtracer": {"core":["LoadImage","SaveSVGNode"],"packs":{"ComfyUI-ToSVG":["TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO"]},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},+ "image-watermark-remove-qwen21": {"core":["CLIPLoader","KSampler","LoadImage","ModelAttentionBackend","PreviewAny","QwenImage21Cache","SaveImage","TextEncodeQwenImage21","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-Qwen-Watermark":["QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect"]},"files":["diffusion_models/qwen_image_2.1_int8_convrot.safetensors","sams/sam_vit_b_01ec64.pth","text_encoders/qwen3vl_8b_int8_convrot.safetensors","vae/qwen_image_2.1_vae_bf16.safetensors"],"optional":[],"vramGb":20,"isolated":false,"firstRun":[]},+ "image-watermark-remove-qwen21-brush": {"core":["CLIPLoader","KSampler","LoadImage","LoadImageMask","ModelAttentionBackend","PreviewAny","QwenImage21Cache","SaveImage","TextEncodeQwenImage21","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-Qwen-Watermark":["QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect"]},"files":["diffusion_models/qwen_image_2.1_int8_convrot.safetensors","sams/sam_vit_b_01ec64.pth","text_encoders/qwen3vl_8b_int8_convrot.safetensors","vae/qwen_image_2.1_vae_bf16.safetensors"],"optional":[],"vramGb":20,"isolated":false,"firstRun":[]},+ "image-watermark-scan-qwen3vl": {"core":["CLIPLoader","LoadImage","PreviewAny"],"packs":{"ComfyUI-Qwen-Watermark":["QWMDetect"]},"files":["text_encoders/qwen3vl_8b_int8_convrot.safetensors"],"optional":[],"vramGb":10,"isolated":false,"firstRun":[]},"infinitetalk-native": {"core":["AudioEncoderEncode","AudioEncoderLoader","BasicScheduler","BatchImagesNode","CFGGuider","CLIPLoader","CLIPTextEncode","ConditioningZeroOut","CreateVideo","KSamplerSelect","LoadAudio","LoadImage","LoraLoaderModelOnly","ModelPatchLoader","PrimitiveInt","RandomNoise","SamplerCustomAdvanced","SaveVideo","UNETLoader","VAEDecode","VAELoader","WanInfiniteTalkToVideo"],"packs":{},"files":["audio_encoders/wav2vec2-chinese-base_fp16.safetensors","diffusion_models/Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","model_patches/wan2.1_infiniteTalk_single_fp16.safetensors","text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},"infinitetalk-wanwrapper": {"core":["CLIPVisionLoader","LoadAudio","LoadImage"],"packs":{"ComfyUI-KJNodes":["GetImageSizeAndCount","INTConstant","ImageResizeKJv2"],"ComfyUI-VideoHelperSuite":["VHS_VideoCombine"],"ComfyUI-WanVideoWrapper":["DownloadAndLoadWav2VecModel","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"]},"files":["clip_vision/clip_vision_h.safetensors","diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf","diffusion_models/wan2.1-i2v-14b-480p-Q8_0.gguf","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","text_encoders/umt5-xxl-enc-bf16.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":["loras/Wan2.1_I2V_14B_FusionX_LoRA.safetensors"],"vramGb":16,"isolated":false,"firstRun":["DownloadAndLoadWav2VecModel downloads TencentGameMate/chinese-wav2vec2-base into models/transformers on first run"],"validated":true},"interpolate-film": {"core":["ComfyMathExpression","CreateVideo","FrameInterpolate","FrameInterpolationModelLoader","GetVideoComponents","LoadVideo","PrimitiveInt","SaveVideo"],"packs":{},"files":["frame_interpolation/film_net_fp16.safetensors"],"optional":[],"vramGb":4,"isolated":false,"firstRun":[],"validated":true},@@ -484,7 +488,6 @@"video-inpaint-wan-vace-painted": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","ComfyMathExpression","CreateVideo","GetImageSize","GetVideoComponents","GrowMask","ImageCompositeMasked","ImageFromBatch","ImageScale","ImageToMask","InvertMask","KSampler","LoadImageMask","LoadVideo","LoraLoaderModelOnly","MaskToImage","ModelSamplingSD3","PrimitiveFloat","PrimitiveInt","SAM3_TrackToMask","SAM3_VideoTrack","SaveImage","SaveVideo","TrimAudioDuration","TrimVideoLatent","UNETLoader","VAEDecode","VAELoader","Video Slice","WanVaceToVideo"],"packs":{"ComfyUI-KJNodes":["GrowMaskWithBlur"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","diffusion_models/wan2.1_vace_14B_fp16.safetensors","loras/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensors","text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors","vae/wan_2.1_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},"video-insert-wan-vace": {"core":["CLIPLoader","CLIPTextEncode","ComfyMathExpression","CreateVideo","GetImageSize","GetVideoComponents","GrowMask","ImageCompositeMasked","ImageFromBatch","ImageScale","ImageToMask","InvertMask","KSampler","LoadImage","LoadImageMask","LoadVideo","LoraLoaderModelOnly","MaskToImage","ModelSamplingSD3","PrimitiveFloat","PrimitiveInt","RepeatImageBatch","SaveVideo","TrimAudioDuration","TrimVideoLatent","UNETLoader","VAEDecode","VAELoader","Video Slice","WanVaceToVideo"],"packs":{"ComfyUI-KJNodes":["GrowMaskWithBlur"]},"files":["diffusion_models/wan2.1_vace_14B_fp16.safetensors","loras/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensors","text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors","vae/wan_2.1_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},"video-mask-h3-relay": {"core":["CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","GetImageSize","GetVideoComponents","ImageBatch","ImageFromBatch","ImageScale","LoadVideo","MaskToImage","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveVideo","Video Slice"],"packs":{"h3-relay":["H3RelayPrepareSource","H3RelayRecoverMasks","H3RelaySelectMask"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[]},- "video-motion-transfer-h3": {"core":["BasicGuider","BasicScheduler","CLIPLoader","ImageScale","ImageScaleToMaxDimension","KSamplerSelect","LoadImage","LoraLoaderModelOnly","MiniMaxH3ReferenceToVideo","MiniMaxH3SigmaShift","ModelAttentionBackend","RandomNoise","SamplerCustomAdvanced","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-Fantastic-MiniMaxH3-PromptBuilder":[],"ComfyUI-KJNodes":["VRAM_Debug"],"ComfyUI-MiniMaxH3-Context-Loop":[],"ComfyUI-VideoHelperSuite":["VHS_LoadVideo","VHS_VideoCombine"],"comfyui-h3-oneclick-swap":["H3SoundtrackOrSilence"],"comfyui_controlnet_aux":["Metric3D-NormalMapPreprocessor"]},"files":["diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors","loras/minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors","text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors","vae/minimax_h3_audio_vae_fp32.safetensors","vae/minimax_h3_video_vae_int8_convrot.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":["Metric3D vit-small (metric_depth_vit_small_800k.pth) -> custom_nodes/comfyui_controlnet_aux/ckpts/JUGGHM/Metric3D (fetched on first run unless placed there)"]},"video-mux-audio": {"core":["AudioAdjustVolume","AudioMerge","ConcatenateVideo","EmptyAudio","LoadAudio","LoadVideo","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},"video-mux-audio-replace": {"core":["ConcatenateVideo","LoadAudio","LoadVideo","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},"video-person-remove-h3-mask": {"core":["CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","EmptyImage","GetImageSize","GetVideoComponents","GrowMask","ImageCompositeMasked","ImageFromBatch","LoadVideo","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveVideo","ThresholdMask"],"packs":{},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[],"validated":true},