Qwen-Image Union Control
使用Qwen-Image統一的ControlNet LoRA進行精確結構控制產生圖像。支援多種控制型別,包括canny、depth、lineart、softedge、normal和openpose,適用於各種創意應用。
關於
Qwen-Image Union Control 工作流程用 Qwen-Image 模型的統一 ControlNet LoRA,為圖片生成提供精準的結構控制。此工作流程整合多種控制類型,例如 canny、depth、lineart、softedge、normal 與 openpose,適用於各式創作需求。透過這些控制,你可以引導圖片生成結果更貼近你的美術意圖或專案需求。
在技術流程上,工作流程使用多個節點來處理並精煉圖片。「LoadImage」節點先匯入參考圖片;「Canny」節點用於邊緣偵測,提供可引導生成的結構輪廓;「ImageScaleToTotalPixels」節點確保輸入圖片縮放到合適大小,以避免輸出品質變差;「PreviewImage」節點用來檢視中間結果;「SaveImage」節點則負責儲存最終已生成圖片。此工作流程適合需要高度控制圖片結構的藝術家與設計師。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"60": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"84:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"73": {
"class_type": "LoadImage",
"inputs": {
"image": "image_qwen_image_union_control_lora_input_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"74": {
"class_type": "Canny",
"inputs": {
"high_threshold": 0.8,
"image": [
"77",
0
],
"low_threshold": 0.4
},
"_meta": {
"title": "Detect Edges (Canny)"
}
},
"75": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"74",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"77": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"73",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"84:3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"84:72",
0
],
"model": [
"84:66",
0
],
"negative": [
"84:71",
0
],
"positive": [
"84:70",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 70741926012422,
"steps": 4
},
"_meta": {
"title": "KSampler"
}
},
"84:37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"84:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"84:39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"84:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"84:38",
0
],
"text": "Extreme close-up shot, realistic digital illustration, close eyes, peaceful,oil painting with thick application, girl with curly hair, large black flower, black nail polish, ring details, soft light and shadow, dark green backdrop, delicate hair texture, smooth skin rendering, fine artistic details, dreamy and elegant atmosphere, dark style, grotesque. White hair, huge black flower behind her (with yellow stamens, green stems and leaves), black turtleneck clothing, green leaves and black flowers around, artistic illustration style, sharp color contrast, mysterious atmosphere, delicate brushstrokes, thick oil painting, thickly applied oil painting, the whole picture is filled with layered flowers, huge, petals spreading, beautiful composition, unexpected angle, layered background. Macro, eyes looking down, thick application, brushstrokes, splatters, mottled, old, extremely romantic, light and shadow, strong contrast, maximalist style, full-frame composition."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"84:66": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"84:79",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"84:69": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "qwen_image_union_diffsynth_lora.safetensors",
"model": [
"84:37",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"84:7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"84:38",
0
],
"text": " "
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"84:70": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"84:6",
0
],
"latent": [
"84:72",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"84:71": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"84:7",
0
],
"latent": [
"84:72",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"84:72": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"74",
0
],
"vae": [
"84:39",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"84:79": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Lightning-4steps-V1.0.safetensors",
"model": [
"84:69",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"84:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"84:3",
0
],
"vae": [
"84:39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
「Canny」節點用於偵測參考圖片的邊緣,提供結構輪廓以引導圖片生成流程。
此工作流程是為參考圖片設計,用來提供結構控制。若要從零生成圖片,請考慮使用不依賴參考圖片的其他工作流程。
控制類型取決於你想要的效果。例如用「canny」做邊緣偵測、「depth」做 3D 效果、「openpose」做姿勢控制。
請確認使用「ImageScaleToTotalPixels」讓輸入圖片尺寸合適,以避免品質問題;你也可以調整控制設定來精煉輸出。
相關工作流程
- Qwen, Qwen-Image
Qwen Image 2512
- Qwen-Image
Qwen Image Edit 2509
- Qwen-Image
Qwen Image:插畫LoRA
- Qwen-Image
Qwen Image:軟糖動物LoRA
- Qwen-Image
Qwen-Image ControlNet 模型補丁
- Qwen-Image
Qwen-Image InstantX ControlNet
- Qwen-Image
Qwen千問-圖像:文生圖
- Qwen-Image
Qwen千問-圖像:文生圖
- Qwen-Image
Qwen千問圖像局部重繪ControlNet
- Qwen-Image, SeedVR2
等距柱狀投影HDR天空盒產生器