DOGMA Insegne - Qwen 2.1 / Inpaint protetto
One Qwen edit pass per sign, and it proves nothing else changed
- approved_jobs
- model
- clip
- vae
- image
- report
The end of the Insegne chain: approved signs in, a repaired photograph out. Each approved element is cropped, sent through a Qwen 2.1 edit pass with its instruction, decoded tiled, and composited back with a feathered alpha. Then the node compares the result against the original everywhere outside the union of your masks, and if a single RGB value moved, it raises instead of returning the image.
That final check is the whole argument for this approach over just asking an edit model to fix the photo. Edit models regenerate the frame; you want a guarantee, and here you get one asserted at runtime rather than promised in a README. The report echoes it: pixels outside the mask are identical to the input.
How it works
For each job the node builds the instruction by combining your approved prompt, the plan's art direction (period, place, materials, lighting, no websites or QR codes), and a preservation preamble covering support, frame, geometry, viewpoint, wear, focus and grain. It then encodes conditioning through ComfyUI's core Qwen 2.1 text-encode node, passing the crop as image 1 - and it does so through a small VAE proxy that forces the reference encode to be tiled at vae_tile_size, because the stock path would encode the full-resolution reference at once and eat VRAM for no reason.
Sampling is a plain KSampler call on a latent carrying the crop's latent plus the job's noise mask, with a per-job seed derived from the base seed and the job ID - so a multi-sign scene does not converge into the same sign twice. The decode is tiled. Then compose: the generated patch is resampled back to the native crop size, the padded edges are trimmed, and the alpha is built from the native mask with a smoothstep ramp over feather_px computed from a distance transform, so the transition is inside the mask and the outside stays literally untouched.
After all jobs, the union mask is assembled and the outside-pixel equality check runs. Failure is a hard error, not a warning, which means a bad composite can never silently reach your output folder.
Inputs and outputs
Required: approved_jobs (DOGMA_SIGN_JOBS, from the review popup), model, clip, vae (all lazy), steps (25), cfg (1.0), sampler_name (euler), scheduler (simple), denoise (1.0), seed (1976), feather_px (6), negative_prompt (a default tuned against garbled lettering, duplicated signs, modern logos, QR codes and plastic texture), and vae_tile_size (4096).
Outputs: image and report (STRING) - the guarantee line plus each element's label and final prompt, which is the record of what you actually asked for.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or ComfyUI Manager → DOGMA Nodes, then restart. The pack's own dependency is just scipy>=1.10; this node additionally needs a ComfyUI recent enough to include the core TextEncodeQwenImage21 node. If that is missing or incompatible you get a named error - "codifica Qwen 2.1 non compatibile" - rather than a stack trace forty frames deep.
Where people get burned
The batch shape. Each sign is a separate inference. Ten approved signs is ten passes and ten decodes, which is fine on a fast card and tedious on a slow one. Raise min_confidence or approve fewer elements; the popup is the cheapest place to trim work.
Feather on small elements. Default 6 px at native resolution is gentle. On a small sign, an aggressive feather eats the interior and you get a half-repair that reads as blur. If a tiny element looks mushy, drop the feather rather than raising denoise.
Empty approved set. With no jobs approved the node returns your input untouched and says so. Nothing to render is not an error.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| approved_jobs | DOGMA_SIGN_JOBS | — | |
| model | MODEL | — | |
| clip | CLIP | — | |
| vae | VAE | — | |
| steps | INT | 251–100 | — |
| cfg | FLOAT | 1.01–12 | — |
| sampler_name | COMBO | euler | 50 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +44 |
| scheduler | COMBO | simple | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 1.000–1 | — |
| seed | INT | 19760–18446744073709550000 | — |
| feather_px | INT | 60–64 | — |
| negative_prompt | STRING | garbled lettering, misspelled words, duplicated signs, extra text, modern logos, QR codes, websites, plastic texture, oversharpening | — |
| vae_tile_size | INT | 4096512–4096 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| report | STRING | — |