The 18 blocks are grouped into 7 uses (a block's "job": repaint,
new_background, upscale, refine, follow, detail, process); a block that is
not its use's default has a "want" word (best, 2x, pose, ...).
add_nodes(use=…, want=…) has reference_blocks.pick choose the first by rank
this ComfyUI can run (packs and models present, not turned off), the block
taking a second picture when one is given; block= by name still works.
begin_task's directory is a line a use with its wants, the rest by what it
needs ("LanPaint: repaint best"), so it no longer grows with the blocks and
the word budget tiers are gone. Tried live: use=new_background with two
pictures built place_in_scene.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
begin_task's text was at its 4000-character limit with every new block. The
directory now shortens in steps: every word while it fits (625 characters),
then the blocks' names with the missing ones grouped by what they need
("LanPaint: inpaint_lanpaint"), then names alone. With every pack in, the
names (about 400) leave begin_task near 3850 even with the stale tool list
line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refine_other_model redraws the made picture at denoise 0.4 with a second
checkpoint of its own (any family: its own CLIP and VAE, prompts copied from
the first, LoRAs added onto it with add_lora) and saves it beside it
(prefix refined), as the reference workflow's refiner keeps a loader and
LoRA stack apart. Tried on an RTX 4050 6 GB, Illustrious then NoobAI at
832x1216: about 66 s for the whole run, the composition kept, the style the
second model's.
A block node may be "like" a path ("$sampler.positive"): it takes the
settings of the node feeding it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
place_in_scene takes two pictures (add_nodes' new scene argument, $scene in
a block marked "scene"): the character is cut out (inspyrenet-rembg), the
place scaled and cropped to its size (GetImageSize, ImageScale), the
character pasted on (ImageCompositeMasked) and everything else redrawn at
denoise 0.5 with the edge grown 6 px, so shadow and ground meet it while
the place keeps its look. Tried on an RTX 4050 6 GB with SDXL (Illustrious)
832x1216: about 40 s.
The blocks' short words are shorter so begin_task stays under 4000
characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
change_scene cuts the character out of a handed picture (inspyrenet-rembg),
inverts it and redraws only the rest at denoise 1.0 from the prompt's new
scene; GrowMask lets 6 px of the edge be redrawn for the seam. Tried on an
RTX 4050 6 GB with SDXL (Illustrious) 832x1216: about 30 s, the character
kept, the forest replaced by a night street.
A picture handed to a block may be written "name.png [output]" as Load
Image shows it. Two block descriptions are shorter so begin_task stays
under 4000 characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- api/block_models.json: the 15 models the ways recommend, each with its
Hugging Face / Civitai / GitHub links, size, SHA256 (all checked against the
sites), licence and folder. A block's "models" names its recommended ones; the
Ways panel ticks those here (by name, or by size for a renamed copy) and
downloads a missing one in a click with model_download.downloadFrom, its hash
checked.
- A block's "tested": the card (RTX 4050 laptop, 6 GB), sizes and a whole run's
time, shown in the panel and told to the AI with the block (answer.tested).
- color_lineart gets an Anima variant with Anima's lineart LLLite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- upscale_tile: the 1.25x upscale with a tile ControlNet holding the redraw
(the source's 0.6 to 80%), so it can redraw at 0.5; NoobAI's tile model for
NoobAI/Illustrious, the union one for SDXL, Anima's tile-repair LLLite on
Anima (slow on a 6 GB card, the AI is told to say so).
- color_lineart: a line drawing, inverted to white on black, steers a lineart
ControlNet; its lines are left as a preview.
- A union ControlNet gets SetUnionControlNetType for what it follows.
ControlNets not scanned yet take their base from their folder or name.
- MissingModel: a block's model not in ComfyUI's lists makes add_nodes read
them anew once (a model just downloaded into a subfolder), then try again.
- The upscales prefer the least enlarging model that reaches their size.
Live on the isolated 8199 ComfyUI: NoobAI tile upscale 77 s, Anima tile 710 s,
lineart colouring 34 s (the union model found after the lists were read anew).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A block's "variants" rebuild it for the canvas model's family
(reference_blocks.build, which also returns its roles and next step): on an
Anima model control_depth and control_pose patch the model with an Anima
ControlNet-LLLite instead of a ControlNet, and inpaint_crop_stitch adds Anima's
repaint LLLite on the crop; the AI still only names the block. Base packs are
checked before the page is asked which model the canvas has.
Live-tested on the isolated 8199 ComfyUI with an Anima model: repaint changed
the marked hand (43.9) and nothing outside (0.0); depth steers gently, so the
Anima next step says the prompt has to agree with the picture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tags_from_picture: WD14 tagger (the source's model and thresholds) on a
picture the user handed; run_status now carries what nodes showed as words
(texts: a tagger's tags), with a summary and next step for a run that made
words but no pictures.
- Optional nodes: a block node marked optional goes when its pack is missing,
and a link "match|decode" takes the first one there. The four upscales end in
KJNodes' ColorMatch (mkl, the source's) when it is installed; the panel says
"better with" it otherwise.
- LanPaint's next step keeps the prompt about the whole picture; Follow a pose
says OpenPose misreads anime (use control_depth), as the source's author did.
- The directory has a size cap: past it, block names alone, so collected ways
never make begin_task long; shorter headings and few-word lines.
Live-tested on the isolated 8199 ComfyUI: LanPaint (area changed 14.6, outside
0.0, 82 s), tiled 2x (167 s), depth ControlNet (follows the layout), OpenPose
(misreads an anime picture), background removal (8 s), tags (166 s with the
model download), upscale with ColorMatch (73 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each block is now api/blocks/<name>.json (nodes, packs, models, the AI's words
and the panel's in both languages), so a way collected later is one more file.
The AI workbench's side column has a Ways view: blocks by job, what each does
and where it came from, greyed with the pack (opens ComfyUI-Manager) or model it
lacks, and a switch (user/anomalous/ai_blocks.json) that keeps it from the AI;
begin_task lists only the blocks on and runnable here, the rest in one line.
New blocks: upscale_iterative (Impact Pack), upscale_two_models ($loader role,
a second loader "like" it), remove_background (inspyrenet-rembg).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A block node can be "like" a role (takes its settings) or "replace" it (its
links, place and settings too; LanPaint's sampler for the KSampler). $save is
the output node the picture reaches, past a stitch. Upscale blocks take an
upscale model this ComfyUI has; control blocks a ControlNet whose base fits the
canvas's model, and the picture to follow copied into the input folder. The
directory is grouped by job, a few words a block, to keep begin_task short.
Drop-down choices are read in both forms of ComfyUI's node list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Flash exam showed the crop-and-stitch repaint painting a whole new
person into the hand: the context margin was 1.2 where the distilled
workflow used 2.0, and the sampler kept denoise 1 and the whole
picture's prompt. A block can now set settings on the canvas nodes it
finds (roles: the sampler's denoise 0.75, in the same Ctrl+Z step),
and the block's answer and the repaint note tell the AI to set the
prompt to what belongs in the area. Retake: a natural hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api/reference_blocks.py holds groups distilled from workflows that do
one job well: a repaint that crops around the mark, repaints at 1024
and stitches back (ComfyUI-Inpaint-CropAndStitch), the same with
built-in nodes only, and face and hand detailing (Impact Pack, the
detector models this ComfyUI has). begin_task hands the AI their
directory; add_nodes(block=...) builds one in one call. Its links name
roles web/modules/canvas_roles.js finds on the canvas by their sockets
(the sampler, its decode and save, what feeds an input upstream), so
canvas_wiring splices it into the workflow there; several samplers
need near_node_id, a missing pack names the pack and the stand-in.
The repaint note now points to the block. Checked on the test ComfyUI:
the repaint changed the marked area only, the detailer the face area.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>