Files
DemonGatanjieu-Anomalous_Mo…/api/blocks/change_scene.json
T
DemonGatanjieuandClaude Opus 5.5 d95b2b309f Ways: new scene, same character
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>
2026-10-28 22:52:30 +08:00

126 lines
3.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"job": "repaint",
"rank": 4,
"short": "new background",
"title": {
"zh": "换场景·人物不变",
"en": "New scene, same character"
},
"about": {
"zh": "你递给 AI 一张图,AMB 自动抠出人物,只重画人物以外的地方:AI 在提示词里写新场景,人物原样留下。人物边缘留几像素一起重画,让新背景和人物接得上。",
"en": "From a picture you hand the AI, the character is cut out automatically and everything else is drawn anew: the prompt says the new scene, the character stays as it was. A few pixels of its edge are redrawn too, so it sits in 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.",
"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
}
]
}
}