AI on the Lot 2026_Qwen-Image-Edit-2511
AI on the Lot 2026 的加碼工作流程,提供給 ComfyUI 101 工作坊學員,如有時間可開啟並跟著操作。這是一個由 Qwen-Image-Edit-2511 驅動的圖像編輯工作流程。
關於
這個 ComfyUI 教學工作流程示範如何使用 Qwen-Image-Edit-2511 進行快速的指令式圖片編輯。它串接一條簡單的 I/O 路徑——LoadImage(或用 VHS_LoadVideo 讀取影格)進入一個精簡的 Subgraph 節點(ID cdb2cf24-c432-439b-b5c8-5f69838580c9)——最後以 SaveImage 結束。在 subgraph 內,編輯由 Qwen 2.5 VL 文字編碼器(qwen_2.5_vl_7b_fp8_scaled.safetensors)驅動,並搭配為速度調校的輕量 LoRA(Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors)。Subgraph 把模型串接封裝起來,你只需要輸入白話指令,例如「把天空變成陰天」或「移除背景」,就能快速預覽結果。
從技術面來看,工作流程會把來源圖片(或影片影格)送入 subgraph,由 Qwen 2.5 VL 編碼器解讀你的指令文字並建立條件設定。Qwen-Image-Edit-2511 Lightning LoRA 會在極少取樣步數下套用已學到的編輯行為,以維持推論速度。由於封裝成 Subgraph,你會得到乾淨的圖形與一致的預設值——需要時也可以雙擊或開啟 subgraph 檢查或微調內部。SaveImage 會把每個結果影格寫入磁碟;當輸入來自 VHS_LoadVideo 時,你會得到編號的影像序列,若需要最終影片可在外部重新組裝。
您提供的內容
- 正在讀取工作流程
在 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({
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Qwen_Edit_2511",
"images": [
"170:158",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"83": {
"class_type": "LoadImage",
"inputs": {
"image": "e52d6a41149aa10f164f8b90e2c2213aa6e373bc5741bc2a5aa1f9d27e9497eb.png"
},
"_meta": {
"title": "Load Image"
}
},
"198": {
"class_type": "VHS_LoadVideo",
"inputs": {
"custom_height": 0,
"custom_width": 0,
"force_rate": 0,
"format": "AnimateDiff",
"frame_load_cap": 1,
"select_every_nth": 1,
"skip_first_frames": 0,
"video": "79b2e7401505e27c90c1be65b5c06cb859be09ea9a394b2a4c4a7650c6f1c5a2.mp4"
},
"_meta": {
"title": "Load Video (Upload) 🎥🅥🅗🅢"
}
},
"170:145": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"170:161",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"170:146": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"170:147": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"170:149",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"170:148": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"170:151",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"170:149": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"170:162",
0
],
"image1": [
"170:160",
0
],
"image2": [
"83",
0
],
"prompt": "",
"vae": [
"170:146",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"170:151": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"170:162",
0
],
"image1": [
"170:160",
0
],
"image2": [
"83",
0
],
"prompt": "Add the t-shirt in image 2 to the boxer in image 1.",
"vae": [
"170:146",
0
]
},
"_meta": {
"title": "TextEncodeQwenImageEditPlus (Positive)"
}
},
"170:152": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"170:145",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"170:153": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"170:152",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"170:154": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"170:155": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"170:156": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"170:160",
0
],
"vae": [
"170:146",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"170:158": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"170:169",
0
],
"vae": [
"170:146",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"170:160": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"198",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"170:161": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"170:162": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"170:163": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"170:152",
0
],
"on_true": [
"170:153",
0
],
"switch": [
"170:168",
0
]
},
"_meta": {
"title": "Switch (Model)"
}
},
"170:164": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"170:154",
0
],
"on_true": [
"170:155",
0
],
"switch": [
"170:168",
0
]
},
"_meta": {
"title": "Switch (CFG)"
}
},
"170:165": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
},
"_meta": {
"title": "Steps"
}
},
"170:166": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 40
},
"_meta": {
"title": "Steps"
}
},
"170:167": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"170:166",
0
],
"on_true": [
"170:165",
0
],
"switch": [
"170:168",
0
]
},
"_meta": {
"title": "Switch (Steps)"
}
},
"170:168": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable 4steps LoRA?"
}
},
"170:169": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"170:164",
0
],
"denoise": 1,
"latent_image": [
"170:156",
0
],
"model": [
"170:163",
0
],
"negative": [
"170:147",
0
],
"positive": [
"170:148",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 551880825670434,
"steps": [
"170:167",
0
]
},
"_meta": {
"title": "KSampler"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
核心節點(LoadImage、SaveImage、MarkdownNote)皆為內建。流程用到 Subgraph 節點(ID cdb2cf24-…),如需處理影片影格可選用 VHS_LoadVideo。若找不到 VHS_LoadVideo,請安裝 VideoHelperSuite (VHS) 擴充,並依說明將模型檔放到 models/text_encoders 與 models/loras。
將 qwen_2.5_vl_7b_fp8_scaled.safetensors 放到 ComfyUI/models/text_encoders,Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors 放到 ComfyUI/models/loras。重新啟動 ComfyUI,即可在子圖內的 model/LoRA 選單看到。
請用高品質輸入圖像,撰寫明確指令(說明目標物、顏色、情境),並聚焦編輯範圍。若效果過強或過弱,可調整子圖內的編輯強度(如有開放),或嘗試不同說法。中等解析度運行也有助於穩定性。
本範本以指令式全局編輯為主,未內建遮罩節點。你可透過精確描述(如「只改外套顏色為深藍」)來局部化變更,或自行擴充遮罩路徑以精細控制區域。
本流程用 SaveImage 儲存影格。處理完後,將編號圖像序列匯入影片剪輯軟體,或用指令列工具(如 ffmpeg)編碼成影片。若想在流程內直接匯出影片,可加上影片寫入節點並接在編輯階段之後。