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)