Qwen-Image ControlNet 模型補丁
使用Qwen千問ControlNet模型控制圖像產生。透過模型補丁支援canny、深度和區域性重繪控制。
關於
Qwen-Image ControlNet Model Patch 工作流程旨在透過 Qwen-Image 模型,為圖片產生提供更強的控制能力。此工作流程整合多個進階節點,包括 KSampler、CLIPTextEncode 以及 QwenImageDiffsynthControlnet,可精準操控 canny、depth 與局部修補等影像屬性。透過 ModelPatchLoader 節點,使用者可以對模型套用補丁,進行動態調整並提升影像品質。此工作流程特別適合需要產生具特定風格或主題元素的藝術家與設計師,因其可利用 ControlNet 技術進行細緻自訂。
在技術面上,工作流程會先載入所需模型與參考圖片,接著將這些輸入送入一系列節點以進行編碼、解碼並套用所需的轉換。VAELoader 與 UNETLoader 節點在管理影像資料上扮演關鍵角色,而 CLIPLoader 與 CLIPTextEncode 節點則負責處理文字提示詞,以引導圖片產生流程。整合 QwenImageDiffsynthControlnet 節點可套用 ControlNet 模型來細化影像細節,使此工作流程能用於產生高品質、可自訂的圖片。
您提供的內容
- 正在讀取工作流程
在 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({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 2.5,
"denoise": 1,
"latent_image": [
"76",
0
],
"model": [
"69",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 91832422759220,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "Conceptual makeup, a fairy girl with pink hair, pink shimmery scales dotted at the corners of her eyes, starry eyeshadow, makeup painting, thin eyebrows, three-dimensional features, a glossy finish, dazzling gold powder, silver fine glitter, a sense of layering and depth in the makeup, decorated with gold ornaments, pearlescent eyeshadow, dreamy makeup, soft pastels and subtle sparkles, a mysterious and fantasy-filled atmosphere, high-end makeup, dappled light on the face, soft lighting, optimal shadows, complex depth of field, dramatic lighting, clear focus, 8k, high quality, Fujifilm filter, surreal, a dreamy pastel wonderland, bright colors, a starry pink background, realistic.\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": " "
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"60": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"66": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"37",
0
],
"sampling": "flow",
"shift": 3.1000000000000005
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"69": {
"class_type": "QwenImageDiffsynthControlnet",
"inputs": {
"end_percent": 1,
"image": [
"72",
0
],
"model": [
"66",
0
],
"model_patch": [
"70",
0
],
"start_percent": 0,
"strength": 1,
"vae": [
"39",
0
]
},
"_meta": {
"title": "Apply Qwen Image DiffSynth ControlNet"
}
},
"70": {
"class_type": "ModelPatchLoader",
"inputs": {
"name": "qwen_image_canny_diffsynth_controlnet.safetensors"
},
"_meta": {
"title": "Load Model Patch"
}
},
"71": {
"class_type": "LoadImage",
"inputs": {
"image": "image_qwen_image_controlnet_patch_input_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"72": {
"class_type": "Canny",
"inputs": {
"high_threshold": 0.2,
"image": [
"75",
0
],
"low_threshold": 0.1
},
"_meta": {
"title": "Detect Edges (Canny)"
}
},
"73": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"72",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"75": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"71",
0
],
"megapixels": 1.68,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"76": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"75",
0
],
"vae": [
"39",
0
]
},
"_meta": {
"title": "VAE Encode"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
請嘗試提升 KSampler 節點的 shift 值,以增強圖像清晰度與亮度。
可以,您可透過 ModelPatchLoader 節點上傳自有模型,自訂圖像生成流程。
可透過調整 KSampler 與 ModelSamplingAuraFlow 節點設定,改變細節層級。
可以,僅用文字提示也能生成圖像,但有參考圖像可提升準確度與細節。
相關工作流程
- 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 InstantX ControlNet
- Qwen-Image
Qwen-Image Union Control
- Qwen-Image
Qwen千問-圖像:文生圖
- Qwen-Image
Qwen千問-圖像:文生圖
- Qwen-Image
Qwen千問圖像局部重繪ControlNet
- Qwen-Image, SeedVR2
等距柱狀投影HDR天空盒產生器