Files
DemonGatanjieu-Anomalous_Mo…/api/blocks/switch_midway.json
T
DemonGatanjieuandClaude Opus 5.5 8ecc261949 Let ready-made blocks say what they hand the next one, and build them as a chain
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>
2026-11-09 00:42:56 +08:00

167 lines
8.8 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": "refine",
"want": "midway",
"rank": 7,
"short": "switch mid-way",
"title": {
"zh": "半途换模型接着画",
"en": "Switch models mid-way"
},
"about": {
"zh": "前面的步数用原模型定下构图,后面的步数换另一个模型接着画完,画风和细节跟着它走。",
"en": "The first steps keep the model's composition, then another model draws the rest, with its look and detail."
},
"source": {
"zh": "复现 Aaalice 双模型路线时用的接力(两个 KSampler Advanced 分段),本机三组对比验证过",
"en": "The relay used to reproduce the Aaalice two-model route (two KSampler Advanced parts), checked in three local comparisons"
},
"packs": {},
"nodes": {
"second_model": {
"class_type": "CheckpointLoaderSimple",
"like": "$loader",
"inputs": {}
},
"first": {
"class_type": "KSamplerAdvanced",
"like": "$sampler",
"inputs": {
"model": [
"$sampler.model",
"*"
],
"positive": [
"$sampler.positive",
"*"
],
"negative": [
"$sampler.negative",
"*"
],
"latent_image": [
"$sampler.latent_image",
"*"
],
"add_noise": "enable",
"start_at_step": 0,
"end_at_step": 21,
"return_with_leftover_noise": "enable"
}
},
"second": {
"class_type": "KSamplerAdvanced",
"replaces": "$sampler",
"inputs": {
"model": [
"second_model",
0
],
"latent_image": [
"first",
0
],
"add_noise": "disable",
"start_at_step": 21,
"end_at_step": 10000,
"return_with_leftover_noise": "disable"
}
}
},
"after": "The canvas's sampler became two: the first runs steps 0 to 21 on the canvas's model, the second (second_model, a new loader that starts as the same model) from step 21 to the end, and the picture goes on to the decode as before. set_model second_model to the other model the user wants, of the same family (it reuses the prompts). A LoRA on the first model (a style) is not on the second: add_lora it onto second_model too when the user wants it kept. 21 is 60% of 35 steps: with other steps set the first sampler's end_at_step and the second's start_at_step both to about 60% (earlier: more of the second model, later: more of the first). er_sde split cleanly on one SDXL model but came out grainy on Anima: on another family's er_sde, dpmpp_2m_sde_gpu or euler is the safe choice for both. To enlarge at the switch too (the composition settled small, the later steps drawing the detail at the larger size, in place of an upscale pass after): add_node LatentUpscaleBy insert_after=first with values {\"upscale_method\": \"nearest-exact\", \"scale_by\": 1.5}, then one set_values: first {\"return_with_leftover_noise\": \"disable\"}, second {\"add_noise\": \"enable\"}. The first part then finishes its picture at the switch and the second noises the enlarged one anew: enlarged with its leftover noise, the picture breaks into coloured blocks. Keep the switch where it was: an earlier one redraws more (colours, clothes). second_model may stay the same model when only the enlargement is wanted. When the workflow already enlarges this picture after it (an upscale pass downstream), ask the user whether to keep that one: two enlargements are rarely wanted, and say the pictures differ in size when comparing. For a picture drawn from an empty latent; then run_workflow.",
"gives": {
"sampler": "second"
},
"own_model": {
"nodes": [
"second_model"
],
"copies_loras": false
},
"notes": "KSampler Advanced: the first part returns its leftover noise, the second adds none and finishes it, so the two parts make one run of the steps. er_sde split, the same model in both parts, one seed each: grainy on two Anima models (Kirazuri all over, Harem 1.5 blotchy), clean on Nova Anime XL (SDXL); dpmpp_2m_sde_gpu and euler split cleanly. Tested on the user's route: Harem 1.5 for steps 0-21, Realskin 1.3 for 21-35, its style LoRA on both, 35 steps dpmpp_2m_sde_gpu beta; on SDXL: Nova Anime XL for steps 0-18, MiaoMiao Harem v2.0 for 18-30, dpmpp_2m_sde_gpu beta. Enlarging 1.5× at the switch (Harem 1.5 both parts, 35 steps, 832×1216 → 1248×1824, about 106 s): with the leftover noise enlarged (nearest-exact, the reference author's wiring) the picture came out covered in coloured blocks at step 21 and blots at step 12, the second part adding noise or not; the first part finishing (return_with_leftover_noise disable) and the second adding noise came out clean, at step 21 keeping the pose and layout, at step 12 changing colours and clothes. GPT's check on the user's Harem 1.5 → Realskin 1.3 card, enlarged at step 21: the AI changed both settings as told, no blocks; pose, hair and colours held, face and hair finer, ornaments and tassels redrawn; about 53 s more than the card's base.",
"models": [],
"tested": {
"gpu": "RTX 4050 Laptop",
"vram_gb": 6,
"runs": [
{
"model": "Anima (Kirazuri → Realskin 1.3 at step 21)",
"size": "1216×832",
"seconds": 79
},
{
"model": "SDXL (Nova Anime XL → MiaoMiao Harem v2.0 at step 18 of 30)",
"size": "832×1216",
"seconds": 41
},
{
"model": "Anima (MiaoMiao Harem 1.5 both parts, enlarged 1.5× at step 21)",
"size": "832×1216 → 1248×1824",
"seconds": 106
}
],
"date": "2026-11-03"
},
"variants": {
"anima": {
"nodes": {
"second_model": {
"class_type": "UNETLoader",
"like": "$loader",
"inputs": {}
},
"first": {
"class_type": "KSamplerAdvanced",
"like": "$sampler",
"inputs": {
"model": [
"$sampler.model",
"*"
],
"positive": [
"$sampler.positive",
"*"
],
"negative": [
"$sampler.negative",
"*"
],
"latent_image": [
"$sampler.latent_image",
"*"
],
"add_noise": "enable",
"start_at_step": 0,
"end_at_step": 21,
"return_with_leftover_noise": "enable",
"steps": 35,
"sampler_name": "dpmpp_2m_sde_gpu",
"scheduler": "beta"
}
},
"second": {
"class_type": "KSamplerAdvanced",
"replaces": "$sampler",
"inputs": {
"model": [
"second_model",
0
],
"latent_image": [
"first",
0
],
"add_noise": "disable",
"start_at_step": 21,
"end_at_step": 10000,
"return_with_leftover_noise": "disable",
"steps": 35,
"sampler_name": "dpmpp_2m_sde_gpu",
"scheduler": "beta"
}
}
},
"after": "The canvas's sampler became two, with the tested Anima sampling (35 steps, dpmpp_2m_sde_gpu, beta): the first runs steps 0 to 21 on the canvas's model, the second (second_model, a new UNET loader that starts as the same model) from step 21 to the end, and the picture goes on to the decode as before. set_model second_model to the other Anima model the user wants (it reuses the text encoder and prompts). A LoRA on the first model (a style) is not on the second: add_lora it onto second_model too when the user wants it kept (the tested route did). Move the switch with the first sampler's end_at_step and the second's start_at_step together (earlier: more of the second model, later: more of the first). Keep dpmpp_2m_sde_gpu: er_sde came out grainy split on two Anima models. To enlarge at the switch too (the composition settled small, the later steps drawing the detail at the larger size, in place of an upscale pass after): add_node LatentUpscaleBy insert_after=first with values {\"upscale_method\": \"nearest-exact\", \"scale_by\": 1.5}, then one set_values: first {\"return_with_leftover_noise\": \"disable\"}, second {\"add_noise\": \"enable\"}. The first part then finishes its picture at the switch and the second noises the enlarged one anew: enlarged with its leftover noise, the picture breaks into coloured blocks. Keep the switch where it was: an earlier one redraws more (colours, clothes). second_model may stay the same model when only the enlargement is wanted. When the workflow already enlarges this picture after it (an upscale pass downstream), ask the user whether to keep that one: two enlargements are rarely wanted, and say the pictures differ in size when comparing. For a picture drawn from an empty latent; then run_workflow."
}
}
}