Nodes/ComfyUI-YogurtNodes/Qwen Generate/Edit Image
ComfyUI Node

Qwen Generate/Edit Image

Qwen Image Generation and Editing, Via Alibaba's DashScope

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
Qwen Generate/Edit Image
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • image
  • images
  • num_images
  • text
  • history
api_key
base_url
model_nameqwen-image-2.0-pro
system_prompt
prompt
sizeauto
n1
negative_prompt
prompt_extendtrue
watermarkfalse
retry_count1
proxy_url
seed-1
timeout0
extra{}

Alibaba's Qwen-Image family is a fascinating case in this ecosystem: the open-weight models are the community's default instruction editor, but the flagship line - Qwen-Image-2.0 - launched API-only. YogurtQwenGenerateImage is the door into that API half: it calls Alibaba's DashScope (百炼) service for text-to-image and multi-image editing, and returns proper IMAGE tensors to your graph.

The inputs, with the ones you'll actually set first:

  • api_key - DashScope key. Leave blank and it tries the pack's qwen/dashscope config or the DASHSCOPE_API_KEY env var.
  • model_name - defaults to qwen-image-2.0-pro. The tooltip recommends the qwen-image-2.0 series for models that support the sync interface.
  • prompt - generation or editing instruction.
  • system_prompt - locally prepended to the prompt (sent as a single user message).
  • size - output resolution like 1024*1024, or auto to let the model decide.
  • n - number of images (1–6, model-dependent cap).
  • negative_prompt - reverse prompt, which most modern API image models quietly don't support well - set it, but don't bet on it.
  • prompt_extend - toggle Qwen's intelligent prompt rewriting.
  • watermark - whether to add the Qwen-Image watermark.
  • seed, retry_count, timeout, proxy_url - the usual.

Optional: image plus image1image4 for multi-image editing, history, and extra (raw JSON merged into the request's parameters or top level). Outputs: image, images, num_images, text, history.

The context you should bring

From the knowledge base: Qwen-Image's Edit line became the default open instruction editor (Apache 2.0, no NSFW policing), but Qwen-Image-2.0 cut the model to 7B, unified generation with editing, and went API-only. This node is that API - so you're getting the current flagship's quality without the weights, and you're paying per call. The multi-image image1image4 inputs are the editing story: describe a change across several reference images in one prompt.

Install and keys

Ships in ComfyUI-YogurtNodes. ComfyUI Manager → search ComfyUI-YogurtNodes → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

Restart ComfyUI, find it under "Yogurt Nodes/LLM". Requires the openai package (DashScope's OpenAI-compatible endpoint) and a DashScope key.

Where people get burned: the base_url defaults to the Beijing region (dashscope.aliyuncs.com) - if your account is provisioned elsewhere, or you need the international endpoint, set it explicitly. And if you're coming from the open-weight Qwen-Image-Edit local workflow, remember this is a metered service: n multiplies cost, so leave it at 1 for tests.

CategoryYogurtNodes/LLM

Inputs (21)

NameTypeDefaultDescription
api_keySTRING百炼 API Key,留空时尝试读取 qwen / dashscope 配置或 DASHSCOPE_API_KEY
base_urlSTRINGDashScope API 根地址,留空时默认使用北京地域
model_nameSTRINGqwen-image-2.0-proQwen 图片模型名称,推荐使用支持同步接口的 qwen-image-2.0 系列
system_promptSTRING本地拼接到主提示词前的系统提示词,接口仍以单轮 user 消息发送
promptSTRING图片生成或编辑提示词
sizeSTRINGauto输出分辨率,例如 1024*1024;auto 表示交给模型决定
nINT11–6输出图片数量,具体上限取决于模型
negative_promptSTRING反向提示词
prompt_extendBOOLEANtrue是否启用 Qwen 的提示词智能改写
watermarkBOOLEANfalse是否添加 Qwen-Image 水印
retry_countINT1请求失败时的重试次数
proxy_urlSTRING代理 URL,格式: protocol://user:pass@addr:port
seedINT-1-1–2147483647随机种子,-1 表示让服务端自动生成
timeoutINT00–2147483647请求超时时间(秒),0 表示不限制
imageoptIMAGE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
historyoptHISTORY
extraoptSTRING{}额外请求参数,支持直接补充到 parameters 或顶层请求体

Outputs (5)

NameTypeDescription
imageIMAGE
imagesIMAGE
num_imagesINT
textSTRING
historyHISTORY