ComfyUI / workflows /api /outpaint-qwen.json
aleph65's picture
Upload workflows/api/outpaint-qwen.json with huggingface_hub
26d84fc verified
Raw
History Blame Contribute Delete
11.2 kB
{
"1": {
"_meta": {
"title": "Source Image"
},
"class_type": "LoadImage",
"inputs": {
"image": "example.png"
}
},
"10": {
"_meta": {
"title": "Resize to fit target"
},
"class_type": "ImageScale",
"inputs": {
"crop": "disabled",
"height": [
"9",
0
],
"image": [
"1",
0
],
"upscale_method": "lanczos",
"width": [
"8",
0
]
}
},
"11": {
"_meta": {
"title": "pad left"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"10",
0
],
"b": [
"2",
0
],
"c": [
"4",
0
],
"expression": "max(floor((b - a.width) * c), 0)"
}
},
"12": {
"_meta": {
"title": "pad right"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"10",
0
],
"b": [
"2",
0
],
"c": [
"11",
0
],
"expression": "max(b - a.width - c, 0)"
}
},
"13": {
"_meta": {
"title": "pad top"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"10",
0
],
"b": [
"3",
0
],
"c": [
"5",
0
],
"expression": "max(floor((b - a.height) * c), 0)"
}
},
"14": {
"_meta": {
"title": "pad bottom"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"10",
0
],
"b": [
"3",
0
],
"c": [
"13",
0
],
"expression": "max(b - a.height - c, 0)"
}
},
"15": {
"_meta": {
"title": "Pad to exact target"
},
"class_type": "ImagePadForOutpaint",
"inputs": {
"bottom": [
"14",
0
],
"feathering": [
"6",
0
],
"image": [
"10",
0
],
"left": [
"11",
0
],
"right": [
"12",
0
],
"top": [
"13",
0
]
}
},
"16": {
"_meta": {
"title": "keep-region mask"
},
"class_type": "InvertMask",
"inputs": {
"mask": [
"15",
1
]
}
},
"17": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
}
},
"18": {
"_meta": {
"title": "Lightning 8-step LoRA"
},
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-8steps-V1.0-bf16.safetensors",
"model": [
"17",
0
],
"strength_model": 1.0
}
},
"19": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"18",
0
],
"shift": 3.1
}
},
"2": {
"_meta": {
"title": "target_width"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 1216
}
},
"20": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"19",
0
],
"pre_cfg": false,
"strength": 1.0
}
},
"21": {
"_meta": {
"title": "Gradient-strength denoise (seam blend)"
},
"class_type": "DifferentialDiffusion",
"inputs": {
"model": [
"20",
0
],
"strength": 1.0
}
},
"22": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b.safetensors",
"device": "default",
"type": "qwen_image"
}
},
"23": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
}
},
"24": {
"_meta": {
"title": "Prompt"
},
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Extend the photo beyond its original borders, continuing the scene seamlessly and photorealistically. Keep the original area exactly unchanged. Consistent lighting, colors and perspective. High quality, sharp details."
}
},
"25": {
"_meta": {
"title": "process_long_side (sampling res cap)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 1344
}
},
"26": {
"_meta": {
"title": "process scale"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"15",
0
],
"c": [
"25",
0
],
"expression": "min(1, c / max(a.width, a.height))"
}
},
"27": {
"_meta": {
"title": "work width"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"15",
0
],
"b": [
"26",
1
],
"expression": "round(a.width * b / 16) * 16"
}
},
"28": {
"_meta": {
"title": "work height"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"15",
0
],
"b": [
"26",
1
],
"expression": "round(a.height * b / 16) * 16"
}
},
"29": {
"_meta": {
"title": "Downscale for sampling"
},
"class_type": "ImageScale",
"inputs": {
"crop": "disabled",
"height": [
"28",
0
],
"image": [
"15",
0
],
"upscale_method": "lanczos",
"width": [
"27",
0
]
}
},
"3": {
"_meta": {
"title": "target_height"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 1216
}
},
"30": {
"class_type": "MaskToImage",
"inputs": {
"mask": [
"15",
1
]
}
},
"31": {
"_meta": {
"title": "Downscale mask"
},
"class_type": "ImageScale",
"inputs": {
"crop": "disabled",
"height": [
"28",
0
],
"image": [
"30",
0
],
"upscale_method": "bilinear",
"width": [
"27",
0
]
}
},
"32": {
"class_type": "ImageToMask",
"inputs": {
"channel": "red",
"image": [
"31",
0
]
}
},
"33": {
"_meta": {
"title": "Qwen Edit encode"
},
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"22",
0
],
"image1": [
"29",
0
],
"prompt": [
"24",
0
],
"vae": [
"23",
0
]
}
},
"34": {
"_meta": {
"title": "Negative (zeroed)"
},
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"33",
0
]
}
},
"35": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"29",
0
],
"vae": [
"23",
0
]
}
},
"36": {
"_meta": {
"title": "Only denoise padded area"
},
"class_type": "SetLatentNoiseMask",
"inputs": {
"mask": [
"32",
0
],
"samples": [
"35",
0
]
}
},
"37": {
"class_type": "KSampler",
"inputs": {
"cfg": 1.0,
"denoise": 1.0,
"latent_image": [
"36",
0
],
"model": [
"21",
0
],
"negative": [
"34",
0
],
"positive": [
"33",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 0,
"steps": 8
}
},
"38": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"37",
0
],
"vae": [
"23",
0
]
}
},
"39": {
"_meta": {
"title": "Fill detail restorer"
},
"class_type": "UpscaleModelLoader",
"inputs": {
"model_name": "RealESRGAN_x4plus.pth"
}
},
"4": {
"_meta": {
"title": "anchor_x (0=left 0.5=center 1=right)"
},
"class_type": "PrimitiveFloat",
"inputs": {
"value": 0.5
}
},
"40": {
"_meta": {
"title": "Upscale sampled result"
},
"class_type": "ImageUpscaleWithModel",
"inputs": {
"image": [
"38",
0
],
"upscale_model": [
"39",
0
]
}
},
"41": {
"_meta": {
"title": "Snap to exact target dims"
},
"class_type": "ImageScale",
"inputs": {
"crop": "disabled",
"height": [
"3",
0
],
"image": [
"40",
0
],
"upscale_method": "lanczos",
"width": [
"2",
0
]
}
},
"42": {
"_meta": {
"title": "Match fill tones to original"
},
"class_type": "ColorMatch",
"inputs": {
"image_ref": [
"10",
0
],
"image_target": [
"41",
0
],
"method": "mkl",
"multithread": true,
"strength": 1.0
}
},
"43": {
"_meta": {
"title": "fill_grain (match photo noise, 0=off)"
},
"class_type": "PrimitiveFloat",
"inputs": {
"value": 0.03
}
},
"44": {
"_meta": {
"title": "Grain the fill to match original"
},
"class_type": "ImageAddNoise",
"inputs": {
"image": [
"42",
0
],
"seed": 0,
"strength": [
"43",
0
]
}
},
"45": {
"_meta": {
"title": "Paste original pixels back"
},
"class_type": "ImageCompositeMasked",
"inputs": {
"destination": [
"44",
0
],
"mask": [
"16",
0
],
"resize_source": false,
"source": [
"15",
0
],
"x": 0,
"y": 0
}
},
"46": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "outpaint/qwen",
"images": [
"45",
0
]
}
},
"5": {
"_meta": {
"title": "anchor_y (0=top 0.5=center 1=bottom)"
},
"class_type": "PrimitiveFloat",
"inputs": {
"value": 0.5
}
},
"6": {
"_meta": {
"title": "feathering (px)"
},
"class_type": "PrimitiveInt",
"inputs": {
"value": 64
}
},
"7": {
"_meta": {
"title": "fit scale"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"1",
0
],
"b": [
"2",
0
],
"c": [
"3",
0
],
"expression": "min(b / a.width, c / a.height)"
}
},
"8": {
"_meta": {
"title": "fit width"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"1",
0
],
"b": [
"7",
1
],
"c": [
"2",
0
],
"expression": "min(round(a.width * b), c)"
}
},
"9": {
"_meta": {
"title": "fit height"
},
"class_type": "MathExpression|pysssss",
"inputs": {
"a": [
"1",
0
],
"b": [
"7",
1
],
"c": [
"3",
0
],
"expression": "min(round(a.height * b), c)"
}
}
}