MiniMax-H3-Image:角色替换
把照片里的人换成参考图中的角色。适配器把照片当作 <Picture 1>、把角色图当作 <Picture 2>,保留原片的姿势、构图与光线,并沿用参考角色的面部、服装与材质。基于 MiniMax-H3-Image,配合 h3_image_character_swap_v1 LoRA(强度 1.0)。
简介
Swap the person in a photo for a character from a reference image. The adapter reads the picture as <Picture 1> and the character as <Picture 2>, keeps the pose, framing and lighting of the shot, and carries over the reference character's face, costume and materials. Built on MiniMax-H3-Image with the h3_image_character_swap_v1 LoRA at strength 1.0.
Graph: CLIPLoader, ConditioningZeroOut, GetImageSize, ImageCompare, KSampler, LoadImage, LoadLoraModel, MarkdownNote, MiniMaxH3ImageConditioning, PrimitiveStringMultiline, ResizeImageMaskNode, SaveImage, UNETLoader, VAEDecode, VAELoader. Output: image (image_minimax_h3_image_character_swap.png).
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。请下载后在 ComfyUI 中打开。
下载工作流查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview此工作流中的文件
- 输出
- 图像
- 作者
- 作者信息暂不可用
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
需要付费的 Cloud 方案和额度。
# 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({
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "image_minimax_h3_image_character_swap",
"images": [
"42",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"29": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "minimax_h3_image_pruned_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"30": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3vl_32b_minimax_h3_int8_convrot.safetensors",
"device": "default",
"type": "minimax"
},
"_meta": {
"title": "Load CLIP"
}
},
"31": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "minimax_h3_image_vae_fp16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"33": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"65",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"38": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"65",
1
],
"model": [
"63",
0
],
"negative": [
"33",
0
],
"positive": [
"65",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 142232601287349,
"steps": 6
},
"_meta": {
"title": "KSampler"
}
},
"42": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"38",
0
],
"vae": [
"31",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"43": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Swap the human in <Picture 1> with human <Picture 2>, also update the human in the mirror"
},
"_meta": {
"title": "Text (user_prompt)"
}
},
"45": {
"class_type": "LoadImage",
"inputs": {
"image": "h3_char_swap_source.png"
},
"_meta": {
"title": "Load Image (Source Image)"
}
},
"48": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"56",
0
],
"resize_type": "scale to multiple",
"resize_type.multiple": 32,
"scale_method": "area"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"50": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"48",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"56": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"45",
0
],
"resize_type": "scale total pixels",
"resize_type.megapixels": 1,
"scale_method": "area"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"62": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": None,
"image_a": [
"48",
0
],
"image_b": [
"9",
0
]
},
"_meta": {
"title": "Compare Images"
}
},
"63": {
"class_type": "LoadLoraModel",
"inputs": {
"loras.0.enabled": True,
"loras.0.lora_name": "h3_image_character_swap_v1.safetensors",
"loras.0.strength": 1,
"model": [
"29",
0
]
},
"_meta": {
"title": "Load LoRA (Model)"
}
},
"64": {
"class_type": "LoadImage",
"inputs": {
"image": "h3_char_swap_reference.png"
},
"_meta": {
"title": "Load Image (Reference Character)"
}
},
"65": {
"class_type": "MiniMaxH3ImageConditioning",
"inputs": {
"clip": [
"30",
0
],
"height": [
"50",
1
],
"images.image_0": [
"48",
0
],
"images.image_1": [
"64",
0
],
"prompt": [
"43",
0
],
"vae": [
"31",
0
],
"width": [
"50",
0
]
},
"_meta": {
"title": "MiniMax H3 Image Conditioning"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)相关工作流
- MiniMax H3 Image
MiniMax-H3-Image:图像编辑
- MiniMax H3 Image
MiniMax-H3-Image:图像编辑(API)
- MiniMax H3 Image
MiniMax-H3-Image:文生图
- MiniMax H3 Image
MiniMax-H3-Image:文生图(API)
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
生成角色三视图
- Qwen-Image-Edit
更换材质
- Qwen-Image-Edit
从新角度查看主体
- Flux.2 Dev, Flux
制作产品样机
- Nano Banana Pro
为角色试穿服装
- Seedream
将你的产品放入新场景
- SSeedVR2
放大图像并修复细节
- Nano Banana Pro
锐化产品照片