Mage-Flow-Edit Turbo: Image Edit
Edit images using a reference photo and text instructions with the Mage-Flow-Edit Turbo model, a distilled 4B-parameter model that produces results in just 4…
下载工作流在 Cloud 中试用 API 文档
简介
Edit images using a reference photo and text instructions with the Mage-Flow-Edit Turbo model, a distilled 4B-parameter model that produces results in just 4…
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。请下载后在 ComfyUI 中打开。
下载工作流此工作流暂无示例输出。
查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview此工作流中的文件
- Comfy Cloud
- 是
- 作者
- 作者信息暂不可用
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
1 获取 API 密钥 ↗
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
需要付费的 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({
"7": {
"class_type": "LoadImage",
"inputs": {
"image": "hot_air_balloons_rising.png"
},
"_meta": {
"title": "Load Image"
}
},
"10": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "Mage_flow_edit_turbo",
"format": "png",
"format.bit_depth": "8-bit",
"format.input_color_space": "sRGB",
"images": [
"12:8",
0
]
},
"_meta": {
"title": "Save Image (Advanced)"
}
},
"12:1": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "mage_flow_edit_turbo_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"12:14": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"7",
0
],
"on_true": [
"12:31",
0
],
"switch": [
"12:19",
0
]
},
"_meta": {
"title": "Switch (Input Source)"
}
},
"12:15": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"12:14",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"12:16": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"12:20",
0
],
"on_true": [
"12:15",
0
],
"switch": [
"12:18",
0
]
},
"_meta": {
"title": "Switch (Width)"
}
},
"12:17": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"12:21",
0
],
"on_true": [
"12:15",
1
],
"switch": [
"12:18",
0
]
},
"_meta": {
"title": "Switch (Height)"
}
},
"12:18": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Boolean (Match Input Size)"
}
},
"12:19": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Boolean (Resize Input Image)"
}
},
"12:20": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1024
},
"_meta": {
"title": "Int (Width)"
}
},
"12:21": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1024
},
"_meta": {
"title": "Int (Height)"
}
},
"12:3": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3vl_4b_bf16.safetensors",
"device": "default",
"type": "mage"
},
"_meta": {
"title": "Load CLIP"
}
},
"12:31": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"7",
0
],
"megapixels": 1,
"resolution_steps": 16,
"upscale_method": "nearest-exact"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"12:4": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "mage_flow_vae_bf16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"12:5": {
"class_type": "TextEncodeMageFlowEdit",
"inputs": {
"batch_size": 1,
"clip": [
"12:3",
0
],
"height": [
"12:17",
0
],
"images.image_1": [
"12:14",
0
],
"negative_prompt": "",
"prompt": "Remove all hot air balloons",
"vae": [
"12:4",
0
],
"width": [
"12:16",
0
]
},
"_meta": {
"title": "TextEncodeMageFlowEdit"
}
},
"12:6": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"12:5",
2
],
"model": [
"12:1",
0
],
"negative": [
"12:5",
1
],
"positive": [
"12:5",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 478849483548042,
"steps": 4
},
"_meta": {
"title": "KSampler"
}
},
"12:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"12:6",
0
],
"vae": [
"12:4",
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)