ComfyUI / workflows /api /qwen-edit-turbo-v4.json
aleph65's picture
Add qwen-edit-turbo-v4 (API format)
1696d5c verified
Raw
History Blame Contribute Delete
12.7 kB
{
"1": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
}
},
"13": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"53:6",
0
],
"shift": 3.1
}
},
"14": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"13",
0
],
"pre_cfg": false,
"strength": 1
}
},
"15": {
"_meta": {
"title": "upscale_input_to_max_size"
},
"class_type": "PrimitiveBoolean",
"inputs": {
"value": true
}
},
"16": {
"_meta": {
"title": "downscale_input_to_max_size"
},
"class_type": "PrimitiveBoolean",
"inputs": {
"value": false
}
},
"20": {
"_meta": {
"title": "Main Image"
},
"class_type": "LoadImage",
"inputs": {
"image": "733427737_18059858666742129_6215894921112236726_n.jpg"
}
},
"21": {
"_meta": {
"title": "Input max size (main)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 2048
}
},
"27": {
"_meta": {
"title": "Main image config"
},
"class_type": "QwenEditConfigPreparer",
"inputs": {
"image": [
"20",
0
],
"ref_crop": "pad",
"ref_longest_edge": [
"54:5",
0
],
"ref_main_image": true,
"ref_upscale": "lanczos",
"to_ref": true,
"to_vl": true,
"vl_crop": "center",
"vl_resize": true,
"vl_target_size": 384,
"vl_upscale": "bicubic"
}
},
"3": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b.safetensors",
"device": "default",
"type": "qwen_image"
}
},
"30": {
"_meta": {
"title": "Reference Image 2 (optional)"
},
"class_type": "LoadImage",
"inputs": {
"image": "b.png"
}
},
"31": {
"_meta": {
"title": "Input max size (ref 2)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 1024
}
},
"37": {
"_meta": {
"title": "Reference image 2 config"
},
"class_type": "QwenEditConfigPreparer",
"inputs": {
"configs": [
"27",
0
],
"image": [
"30",
0
],
"ref_crop": "center",
"ref_longest_edge": [
"55:5",
0
],
"ref_main_image": false,
"ref_upscale": "lanczos",
"to_ref": true,
"to_vl": true,
"vl_crop": "center",
"vl_resize": true,
"vl_target_size": 384,
"vl_upscale": "bicubic"
}
},
"4": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
}
},
"40": {
"_meta": {
"title": "Qwen Edit Encode (prompt here)"
},
"class_type": "TextEncodeQwenImageEditPlusCustom_lrzjason",
"inputs": {
"clip": [
"3",
0
],
"configs": [
"57",
0
],
"instruction": "",
"prompt": "replace the outfit of the subject in the first image with the outfit in the second image, don't change anything else. do not change the body's anatomy or shape or skin tone. only put the outfit onto the person in the first image. ",
"return_full_refs_cond": true,
"vae": [
"4",
0
]
}
},
"41": {
"class_type": "QwenEditOutputExtractor",
"inputs": {
"custom_output": [
"40",
2
]
}
},
"42": {
"_meta": {
"title": "Negative (zeroed)"
},
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"40",
0
]
}
},
"43": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"53:14",
0
],
"denoise": 1,
"latent_image": [
"40",
1
],
"model": [
"14",
0
],
"negative": [
"42",
0
],
"positive": [
"40",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 440984114065874,
"steps": [
"53:11",
0
]
}
},
"44": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"43",
0
],
"vae": [
"4",
0
]
}
},
"45": {
"_meta": {
"title": "Remove padding"
},
"class_type": "CropWithPadInfo",
"inputs": {
"image": [
"44",
0
],
"pad_info": [
"41",
0
]
}
},
"46": {
"_meta": {
"title": "upscale_output_to_selected_size"
},
"class_type": "PrimitiveBoolean",
"inputs": {
"value": true
}
},
"47": {
"_meta": {
"title": "Selected output size"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 2560
}
},
"48": {
"_meta": {
"title": "Scale output"
},
"class_type": "ImageScaleToMaxDimension",
"inputs": {
"image": [
"45",
0
],
"largest_size": [
"47",
0
],
"upscale_method": "lanczos"
}
},
"49": {
"_meta": {
"title": "Output size switch"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"45",
0
],
"on_true": [
"48",
0
],
"switch": [
"46",
0
]
}
},
"5": {
"_meta": {
"title": "Sampling mode: 1=4-step / 2=8-step / 3=quality"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 1
}
},
"50": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "qwen-edit-turbo-v4",
"images": [
"49",
0
]
}
},
"52": {
"_meta": {
"title": "User LoRAs"
},
"class_type": "Power Lora Loader (rgthree)",
"inputs": {
"lora_1": {
"lora": "Qwen_LoRA_Skin_Fix_v2.safetensors",
"on": false,
"strength": 1,
"strengthTwo": null
},
"lora_2": {
"lora": "Qwen_LoRA_Amateur_Photo_v1.safetensors",
"on": false,
"strength": 1,
"strengthTwo": null
},
"model": [
"1",
0
]
}
},
"53:1": {
"_meta": {
"title": "LoRA: Lightning 4 steps"
},
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"52",
0
],
"strength_model": 1
}
},
"53:10": {
"_meta": {
"title": "Steps switch 4/8"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"53:7",
0
],
"on_true": [
"53:8",
0
],
"switch": [
"53:3",
2
]
}
},
"53:11": {
"_meta": {
"title": "Steps switch quality"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"53:10",
0
],
"on_true": [
"53:9",
0
],
"switch": [
"53:4",
2
]
}
},
"53:12": {
"_meta": {
"title": "CFG (lightning)"
},
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1.0
}
},
"53:13": {
"_meta": {
"title": "CFG (quality)"
},
"class_type": "PrimitiveFloat",
"inputs": {
"value": 3.0
}
},
"53:14": {
"_meta": {
"title": "CFG switch"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"53:12",
0
],
"on_true": [
"53:13",
0
],
"switch": [
"53:4",
2
]
}
},
"53:2": {
"_meta": {
"title": "LoRA: Lightning 8 steps"
},
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-8steps-V1.0-bf16.safetensors",
"model": [
"52",
0
],
"strength_model": 1
}
},
"53:3": {
"_meta": {
"title": "is 8-step (mode == 2)"
},
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a == 2",
"values.a": [
"5",
0
]
}
},
"53:4": {
"_meta": {
"title": "is quality (mode == 3)"
},
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a == 3",
"values.a": [
"5",
0
]
}
},
"53:5": {
"_meta": {
"title": "Model switch 4/8"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"53:1",
0
],
"on_true": [
"53:2",
0
],
"switch": [
"53:3",
2
]
}
},
"53:6": {
"_meta": {
"title": "Model switch quality"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"53:5",
0
],
"on_true": [
"52",
0
],
"switch": [
"53:4",
2
]
}
},
"53:7": {
"_meta": {
"title": "Steps (4-step)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
}
},
"53:8": {
"_meta": {
"title": "Steps (8-step)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 8
}
},
"53:9": {
"_meta": {
"title": "Steps (quality)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 12
}
},
"54:1": {
"_meta": {
"title": "native edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"20",
0
],
"expression": "max(a.width, a.height)"
}
},
"54:2": {
"_meta": {
"title": "upscaled edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"20",
0
],
"c": [
"21",
0
],
"expression": "max(a.width, a.height, c)"
}
},
"54:3": {
"_meta": {
"title": "apply upscale"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"54:1",
0
],
"on_true": [
"54:2",
0
],
"switch": [
"15",
0
]
}
},
"54:4": {
"_meta": {
"title": "downscaled edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"54:3",
0
],
"c": [
"21",
0
],
"expression": "min(a, c)"
}
},
"54:5": {
"_meta": {
"title": "apply downscale"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"54:3",
0
],
"on_true": [
"54:4",
0
],
"switch": [
"16",
0
]
}
},
"55:1": {
"_meta": {
"title": "native edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"30",
0
],
"expression": "max(a.width, a.height)"
}
},
"55:2": {
"_meta": {
"title": "upscaled edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"30",
0
],
"c": [
"31",
0
],
"expression": "max(a.width, a.height, c)"
}
},
"55:3": {
"_meta": {
"title": "apply upscale"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"55:1",
0
],
"on_true": [
"55:2",
0
],
"switch": [
"15",
0
]
}
},
"55:4": {
"_meta": {
"title": "downscaled edge"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"55:3",
0
],
"c": [
"31",
0
],
"expression": "min(a, c)"
}
},
"55:5": {
"_meta": {
"title": "apply downscale"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"55:3",
0
],
"on_true": [
"55:4",
0
],
"switch": [
"16",
0
]
}
},
"56": {
"_meta": {
"title": "Use Reference Image 2"
},
"class_type": "PrimitiveBoolean",
"inputs": {
"value": true
}
},
"57": {
"_meta": {
"title": "Ref 2 on/off switch"
},
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"27",
0
],
"on_true": [
"37",
0
],
"switch": [
"56",
0
]
}
}
}