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,…
Acerca de
Edit images by following natural language instructions with Mage-Flow-Edit, an instruction-based model that handles background replacement, style changes,…
Lo que proporcionas
- Leyendo el flujo de trabajo
Se ejecuta en ComfyUI. Este flujo de trabajo no puede ejecutarse en esta página. Descárgalo y ábrelo en ComfyUI.
Descargar flujo de trabajoAún no hay resultados de muestra para este flujo de trabajo.
Dentro del flujo de trabajo
Una vista previa de solo lectura del gráfico de nodos. Ábrelo en Comfy Cloud o descárgalo para editar los nodos.
Loading the graph
Open full-size workflow previewArchivos de este flujo de trabajo
- Comfy Cloud
- Sí
- Autor
- Autor no disponible
Requiere nodos personalizados
- Leyendo el flujo de trabajo
Usa este flujo de trabajo desde código
Se genera a partir del gráfico y las entradas del flujo de trabajo cuando es posible; de lo contrario, se muestran ejemplos almacenados. Revisa las credenciales y los endpoints antes de ejecutar el código, ya que puede generar cargos.
What you need
- Runs on
- Comfy Cloud
- Clave
- COMFY_API_KEY
Requiere un plan de pago de Cloud y créditos.
# 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)