Qwen-Image 2512:趣味聯盟控制網
上傳圖片並從Canny、HED、深度、姿態、MLSD、塗鴉或灰階中選取一種控制類型。根據所選的結構條件產生新圖片。
下載工作流程在 Cloud 中試用 API 文件
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# 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": "Qwen-Image-2512",
"images": [
"86:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"121": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"122": {
"class_type": "Canny",
"inputs": {
"high_threshold": 0.35,
"image": [
"123",
0
],
"low_threshold": 0.33
},
"_meta": {
"title": "Detect Edges (Canny)"
}
},
"123": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"121",
0
],
"resize_type": "scale total pixels",
"resize_type.megapixels": 1.6,
"scale_method": "area"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"125": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"123",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"126": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"122",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"86:111": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Lightning-4steps-V1.0.safetensors",
"model": [
"86:37",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"86:112": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"86:37",
0
],
"on_true": [
"86:111",
0
],
"switch": [
"86:118",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"86:113": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 50
},
"_meta": {
"title": "Steps"
}
},
"86:115": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"86:116": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
},
"_meta": {
"title": "Steps"
}
},
"86:117": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"86:118": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Enable 4 Steps LoRA?"
}
},
"86:119": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"86:113",
0
],
"on_true": [
"86:116",
0
],
"switch": [
"86:118",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"86:120": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"86:115",
0
],
"on_true": [
"86:117",
0
],
"switch": [
"86:118",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"86:121": {
"class_type": "ControlNetApplyAdvanced",
"inputs": {
"control_net": [
"86:122",
0
],
"end_percent": 1,
"image": [
"122",
0
],
"negative": [
"86:7",
0
],
"positive": [
"86:81",
0
],
"start_percent": 0,
"strength": 1,
"vae": [
"86:39",
0
]
},
"_meta": {
"title": "Apply ControlNet"
}
},
"86:122": {
"class_type": "ControlNetLoader",
"inputs": {
"control_net_name": "Qwen-Image-2512-Fun-Controlnet-Union-2602.safetensors"
},
"_meta": {
"title": "Load ControlNet Model"
}
},
"86:3": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"86:120",
0
],
"denoise": 1,
"latent_image": [
"86:58",
0
],
"model": [
"86:66",
0
],
"negative": [
"86:121",
1
],
"positive": [
"86:121",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 985578626029454,
"steps": [
"86:119",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"86:37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_2512_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"86:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"86:39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"86:58": {
"class_type": "EmptySD3LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"125",
1
],
"width": [
"125",
0
]
},
"_meta": {
"title": "EmptySD3LatentImage"
}
},
"86:66": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"86:112",
0
],
"sampling": "flow",
"shift": 3.1000000000000005
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"86:7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"86:38",
0
],
"text": "低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感,人脸无细节,过度光滑,画面具有AI感。构图混乱。文字模糊,扭曲"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"86:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"86:3",
0
],
"vae": [
"86:39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"86:81": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"86:38",
0
],
"text": "A vast underwater cathedral grown from living coral, its arches formed by the curved white ribs of an ancient whale skeleton encrusted with pink and violet coral, sea fans and barnacles. The arches recede in a long perspective tunnel toward a bright opening where sunlight floods down through blue water in shimmering god rays. The floor is pale rippled sand dotted with clusters of anemones, starfish and small sea urchins, with a giant open clam shell resting near the centre catching the light. Schools of tiny silver fish drift between the ribs, and soft caustic light patterns dance across every surface. Photorealistic underwater photography, deep turquoise and teal water, warm coral pinks and sandy golds, crisp detail, calm and dreamlike atmosphere, no divers or people."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
}
})
workflow.set_input("121", "image", client.assets.from_url("https://comfy.org/catalog-media/6116c337-3883-4a70-a93d-5d1dc06c0ec4/1d4b583e-cc57-4e12-a00d-bc9598e92091"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("60"):
output.to_file(output.name)試試範例
關於此工作流程
Qwen-Image 2512:Fun Union ControlNet 工作流程用於在不同控制類型(如 Canny、HED、Depth、Pose、MLSD、Scribble 或 Grayscale)的結構引導下進行影像轉換。此工作流程使用 Qwen-Image 2512 模型生成新影像,在允許創意變化的同時保留輸入影像的結構完整性。流程從上傳圖片並選擇控制類型開始;控制類型會決定生成新圖時所遵循的結構條件。
在技術上,本工作流程透過一系列節點對輸入圖片做前處理並套用所選控制類型。例如 Canny 節點用於邊緣偵測,Depth 節點用於理解影像的空間結構。ResizeImageMaskNode 與 GetImageSize 節點確保影像尺寸適合處理。PreviewImage 節點可在最終用 SaveImage 儲存前先預覽結果。此工作流程特別適合希望在保留關鍵結構元素的前提下,探索不同風格詮釋的藝術家與設計師。
問答
具有清楚結構元素的圖片(例如人像或建築照片)最適合,因為可充分受益於 Canny、Depth 等控制類型。
目前工作流程一次只支援選擇一種控制類型來引導影像生成。
某些控制類型可能需要 comfyui_controlnet_aux 外掛才能正常運作或達到較佳效果。
請使用高解析度的輸入圖片,並選擇能凸顯你想強調結構特徵的控制類型。
相關工作流程
- Qwen-Image 2512
Qwen-Image 2512 Turbo
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region