Mage-Flow-Edit: Image Edit
Edit images by following natural language instructions with Mage-Flow-Edit, an instruction-based model that handles background replacement, style changes,…
ワークフローをダウンロードCloudで試す API ドキュメント
概要
Edit images by following natural language instructions with Mage-Flow-Edit, an instruction-based model that handles background replacement, style changes,…
入力するもの
- ワークフローを読み込み中
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 JSONをダウンロードAPI ドキュメント ↗
# 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": "calm_amid_ruin.png"
},
"_meta": {
"title": "Load Image"
}
},
"10": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "Mage_flow_edit",
"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_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"12:14": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"7",
0
],
"on_true": [
"12:26",
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:26": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"7",
0
],
"megapixels": 1,
"resolution_steps": 16,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"12:3": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3vl_4b_bf16.safetensors",
"device": "default",
"type": "mage"
},
"_meta": {
"title": "Load CLIP"
}
},
"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": "Keep the woman, pose, pink dress, chair, and reading unchanged. Replace the background with a wide, flat grassland prairie under soft golden sunlight, open sky, endless green fields.",
"vae": [
"12:4",
0
],
"width": [
"12:16",
0
]
},
"_meta": {
"title": "TextEncodeMageFlowEdit"
}
},
"12:6": {
"class_type": "KSampler",
"inputs": {
"cfg": 5,
"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": 1088076636138798,
"steps": 30
},
"_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)