Every block in api/blocks names what it gives a block after it ("gives": its sampler and its
output node; {} for one that changes the step it is put on) and its own model loader
("own_model"). api/block_chain.py builds a list of steps on a new tab: the picture first, each
next block anchored to what the step before gave, by near_node_id and a new page-only
save_node_id (canvas_roles.js findRoles pins the output node), so a canvas with several
samplers and outputs is no guess. add_nodes' answer names the block it built.
Redraw with another model and face/hand detailing now take the step before's picture
("$save.images") instead of the sampler's decode, which after an enlargement is the older
picture. The two-model routes are built as two-step chains; routes.json no longer names the
loaders.
Checked through the real page on the test ComfyUI: the Tile route on two Anima models (base on
Harem 1.5, Tile redraw on Kirazuri v4, from the base's picture and prompts), then face and hand
detailing after it took the Tile step's colour-matched picture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
127 lines
3.0 KiB
JSON
127 lines
3.0 KiB
JSON
{
|
||
"job": "new_background",
|
||
"rank": 4,
|
||
"short": "new background",
|
||
"title": {
|
||
"zh": "换场景·人物不变",
|
||
"en": "New scene, same character"
|
||
},
|
||
"about": {
|
||
"zh": "自动抠出人物,只按新场景重画背景。",
|
||
"en": "Cuts the character out and redraws only the background as the new scene."
|
||
},
|
||
"source": {
|
||
"zh": "常见的“抠图换背景”做法:inspyrenet-rembg 抠人物,反选成背景,用 ComfyUI 自带的局部重绘节点只重画背景",
|
||
"en": "The common cut-out-and-replace-the-background way: inspyrenet-rembg finds the character, its inverse is the background, ComfyUI's own inpainting nodes redraw only that"
|
||
},
|
||
"packs": {
|
||
"InspyrenetRembg": "comfyui-inspyrenet-rembg"
|
||
},
|
||
"takes": "picture",
|
||
"nodes": {
|
||
"picture": {
|
||
"class_type": "LoadImage",
|
||
"inputs": {
|
||
"image": "$image"
|
||
}
|
||
},
|
||
"cut": {
|
||
"class_type": "InspyrenetRembg",
|
||
"inputs": {
|
||
"image": [
|
||
"picture",
|
||
0
|
||
],
|
||
"torchscript_jit": "default"
|
||
}
|
||
},
|
||
"background": {
|
||
"class_type": "InvertMask",
|
||
"inputs": {
|
||
"mask": [
|
||
"cut",
|
||
1
|
||
]
|
||
}
|
||
},
|
||
"edge": {
|
||
"class_type": "GrowMask",
|
||
"inputs": {
|
||
"mask": [
|
||
"background",
|
||
0
|
||
],
|
||
"expand": 6,
|
||
"tapered_corners": true
|
||
}
|
||
},
|
||
"soft": {
|
||
"class_type": "DifferentialDiffusion",
|
||
"inputs": {
|
||
"model": [
|
||
"$sampler.model",
|
||
"*"
|
||
]
|
||
},
|
||
"wire_to": "$sampler"
|
||
},
|
||
"encode": {
|
||
"class_type": "VAEEncode",
|
||
"inputs": {
|
||
"pixels": [
|
||
"picture",
|
||
0
|
||
],
|
||
"vae": [
|
||
"$decode.vae",
|
||
"*"
|
||
]
|
||
}
|
||
},
|
||
"area": {
|
||
"class_type": "SetLatentNoiseMask",
|
||
"inputs": {
|
||
"samples": [
|
||
"encode",
|
||
0
|
||
],
|
||
"mask": [
|
||
"edge",
|
||
0
|
||
]
|
||
},
|
||
"wire_to": "$sampler"
|
||
},
|
||
"look": {
|
||
"class_type": "PreviewImage",
|
||
"inputs": {
|
||
"images": [
|
||
"cut",
|
||
0
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"roles": {
|
||
"sampler": {
|
||
"denoise": 1.0
|
||
}
|
||
},
|
||
"after": "Write the new scene in the prompt and keep the character's own words (who, hair, clothes) so its edge fits, then run_workflow. The picture's size is the drawing's: the empty latent is no longer used. The kept character (cut out) is among the run's previews: if part of it is missing or the old background clings to it, say so; a halo at its edge: raise the GrowMask expand (6) a little.",
|
||
"gives": {},
|
||
"notes": "Denoise 1.0: the background is drawn anew, not changed. GrowMask lets the background reach 6 px into the character so the seam is redrawn.",
|
||
"models": [],
|
||
"tested": {
|
||
"gpu": "RTX 4050 Laptop",
|
||
"vram_gb": 6,
|
||
"date": "2026-10-28",
|
||
"runs": [
|
||
{
|
||
"model": "SDXL (Illustrious)",
|
||
"size": "832×1216",
|
||
"seconds": 30
|
||
}
|
||
]
|
||
}
|
||
}
|