Product Mockup(Flux.2 Dev FP8)
Create product mockups by applying design patterns to packaging, mugs, and other products using multi-reference consistency.
简介
This ComfyUI workflow is designed to create realistic product mockups by applying design patterns to various items such as packaging and mugs. It leverages the Flux.2 Dev model, which is known for its ability to maintain multi-reference consistency, ensuring that the design patterns are applied uniformly across different surfaces and angles.
The workflow utilizes several key nodes, including SaveImage and LoadImage, to manage input and output efficiently. Additionally, the workflow incorporates a MarkdownNote node for documentation purposes, and specific nodes identified by unique IDs to handle the image processing tasks. By using quantized weights from the Flux.2 Dev model, this workflow optimizes performance without compromising on quality, making it an excellent choice for designers and marketers who need to visualize product designs quickly and effectively.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- ComfyUI
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
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": "Flux2",
"images": [
"62:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"42": {
"class_type": "LoadImage",
"inputs": {
"image": "image_flux2_input_ref_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"46": {
"class_type": "LoadImage",
"inputs": {
"image": "image_flux2_input_Illustration.png"
},
"_meta": {
"title": "Load Image"
}
},
"64": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2",
"images": [
"63:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"62:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"62:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux2_dev_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"62:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"62:22",
0
],
"latent_image": [
"62:47",
0
],
"noise": [
"62:25",
0
],
"sampler": [
"62:16",
0
],
"sigmas": [
"62:48",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"62:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"62:22": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"62:39",
0
],
"model": [
"62:12",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"62:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 120839687766682
},
"_meta": {
"title": "RandomNoise"
}
},
"62:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"62:6",
0
],
"guidance": 4
},
"_meta": {
"title": "FluxGuidance"
}
},
"62:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "mistral_3_small_flux2_fp8.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"62:39": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"62:43",
0
],
"latent": [
"62:40",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"62:40": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"62:41",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"62:41": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"46",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"62:43": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"62:26",
0
],
"latent": [
"62:44",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"62:44": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"62:45",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"62:45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"42",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"62:47": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"62:63",
1
],
"width": [
"62:63",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"62:48": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"62:63",
1
],
"steps": 20,
"width": [
"62:63",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"62:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"62:38",
0
],
"text": "Apply the design from Reference Image 1 onto objects in Reference Image 2.\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"62:63": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"62:45",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"62:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"62:13",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"63:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"63:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux2_dev_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"63:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"63:22",
0
],
"latent_image": [
"63:47",
0
],
"noise": [
"63:25",
0
],
"sampler": [
"63:16",
0
],
"sigmas": [
"63:48",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"63:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"63:22": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"63:39",
0
],
"model": [
"63:63",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"63:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 120839687766682
},
"_meta": {
"title": "RandomNoise"
}
},
"63:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"63:6",
0
],
"guidance": 4
},
"_meta": {
"title": "FluxGuidance"
}
},
"63:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "mistral_3_small_flux2_fp8.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"63:39": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"63:43",
0
],
"latent": [
"63:40",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"63:40": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"63:41",
0
],
"vae": [
"63:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"63:41": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"46",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"63:43": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"63:26",
0
],
"latent": [
"63:44",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"63:44": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"63:45",
0
],
"vae": [
"63:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"63:45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"42",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"63:47": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"63:65",
1
],
"width": [
"63:65",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"63:48": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"63:65",
1
],
"steps": 8,
"width": [
"63:65",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"63:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"63:38",
0
],
"text": "Apply the design from Reference Image 1 onto objects in Reference Image 2.\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"63:63": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Flux2TurboComfyv2.safetensors",
"model": [
"63:12",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"63:65": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"63:45",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"63:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"63:13",
0
],
"vae": [
"63:10",
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)常见问答
Multi-reference consistency ensures that design patterns are applied uniformly across different surfaces and angles, maintaining a cohesive look.
Quantized weights optimize the model's performance, allowing for faster processing times without sacrificing image quality.
Yes, as long as you have a clear image of the product and a compatible design pattern, this workflow can be adapted to various product types.
Ensure your input images are high quality and configure the nodes correctly to maintain design consistency across the product.