MOSS-Image: Color & Depth Control
Re-pose and re-style a reference photo with MOSS-Image: the graph estimates the reference's geometry with MoGe 3, then generates a new image that keeps the…
下载工作流在 Cloud 中试用 API 文档
简介
Re-pose and re-style a reference photo with MOSS-Image: the graph estimates the reference's geometry with MoGe 3, then generates a new image that keeps the…
你需要提供
- 正在读取工作流
在 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({
"1": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "moss_image_sft_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"2": {
"class_type": "SkipLayerGuidanceDiTSimple",
"inputs": {
"double_layers": "",
"end_percent": 1,
"model": [
"36",
0
],
"single_layers": "24",
"start_percent": 0
},
"_meta": {
"title": "SkipLayerGuidanceDiTSimple (uncond skips block 22)"
}
},
"3": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3.5_9b_int8_convrot.safetensors",
"device": "default",
"type": "moss_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"4": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae_small.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"5": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"3",
0
],
"text": "a photograph of a woman in the night city"
},
"_meta": {
"title": "Positive Prompt"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"3",
0
],
"text": "nsfw, worst quality, bad anatomy, watermark, jpeg artifact"
},
"_meta": {
"title": "Negative Prompt"
}
},
"9": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"20",
0
],
"vae": [
"4",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"16": {
"class_type": "TemporalScoreRescaling",
"inputs": {
"model": [
"49",
0
],
"tsr_k": 0.95,
"tsr_sigma": 1
},
"_meta": {
"title": "TSR - Temporal Score Rescaling"
}
},
"20": {
"class_type": "SamplerCustom",
"inputs": {
"add_noise": True,
"cfg": 3,
"latent_image": [
"54",
0
],
"model": [
"2",
0
],
"negative": [
"53",
1
],
"noise_seed": 1099957152091484,
"positive": [
"53",
0
],
"sampler": [
"21",
0
],
"sigmas": [
"22",
0
]
},
"_meta": {
"title": "SamplerCustom"
}
},
"21": {
"class_type": "SamplerER_SDE",
"inputs": {
"eta": 1,
"max_stage": 3,
"s_noise": 1.05,
"solver_type": "ER-SDE"
},
"_meta": {
"title": "SamplerER_SDE"
}
},
"22": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"2",
0
],
"scheduler": "simple",
"steps": 25
},
"_meta": {
"title": "BasicScheduler"
}
},
"36": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"16",
0
],
"sampling": "flow",
"shift": 5
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"49": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "moss_image_color_depth_control.safetensors",
"model": [
"1",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"53": {
"class_type": "MOSSImageControl",
"inputs": {
"depth_map": [
"79",
0
],
"end_percent": 0.6,
"negative": [
"6",
0
],
"positive": [
"5",
0
],
"start_percent": 0,
"strength": 1,
"vae": [
"4",
0
]
},
"_meta": {
"title": "MOSS-Image Color/Depth Control"
}
},
"54": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": [
"61",
1
],
"width": [
"61",
0
]
},
"_meta": {
"title": "Empty Latent Image"
}
},
"55": {
"class_type": "LoadImage",
"inputs": {
"image": "fashion_portrait_red_canyon.png"
},
"_meta": {
"title": "Load Image"
}
},
"61": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"77",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"77": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"55",
0
],
"megapixels": 1,
"resolution_steps": 16,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"79": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"76:75",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"80": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": {
"__value__": [
"",
""
]
},
"image_a": [
"79",
0
],
"image_b": [
"85",
0
]
},
"_meta": {
"title": "Compare Images"
}
},
"81": {
"class_type": "Painter",
"inputs": {
"bg_color": "#000000",
"height": 512,
"mask": "",
"width": 512
},
"_meta": {
"title": "Painter"
}
},
"85": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "image_moss_image_color_depth_control",
"images": [
"9",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"76:73": {
"class_type": "LoadMoGeModel",
"inputs": {
"model_name": "moge_3_vitg_fp16.safetensors"
},
"_meta": {
"title": "Load MoGe Model"
}
},
"76:74": {
"class_type": "MoGeInference",
"inputs": {
"apply_mask": True,
"batch_size": 4,
"force_projection": True,
"fov_x_degrees": 0,
"image": [
"77",
0
],
"moge_model": [
"76:73",
0
],
"refine_steps": 3,
"resolution_level": 9
},
"_meta": {
"title": "Run MoGe Inference"
}
},
"76:75": {
"class_type": "MoGeRender",
"inputs": {
"moge_geometry": [
"76:74",
0
],
"output": "depth"
},
"_meta": {
"title": "Render MoGe Geometry"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)