UltraTex: Texture a 3D Model
Texture an untextured mesh from a single reference image. UltraTex renders the mesh into six world-normal views, paints albedo and metallic/roughness with...
About
Texture an untextured mesh from a single reference image. UltraTex renders the mesh into six world-normal views, paints albedo and metallic/roughness with two UltraTex LoRA passes on FLUX.2 Klein 9B, then bakes the result onto the mesh UVs and exports a PBR GLB with its PNG maps.
Graph: ApplyTextureToMesh, BakeTextureFromViews, BlockSparseAttention, ConditioningLoader, CreateCameraOrbit, EmptyFlux2LatentImage, Get3DComponents, KSampler, Load3DAdvanced, LoadBackgroundRemovalModel, LoadImage, LoraLoaderModelOnly, MarkdownNote, MaskPreview, PreviewImage, RemoveBackground, RenderMesh, ResizeAndPadImage, SaveGLB, SaveImageAdvanced, SplitImageChannels, UNETLoader, UltraTexConditioning, VAEDecode, VAELoader, b6610733-f2f0-4f83-9281-42e1aa892a5a. Output: 3d (ultratex_texture_3d_model.glb).
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can't run on this page. Download it and open it in ComfyUI.
Download WorkflowNo sample outputs for this workflow yet.
Inside the workflow
A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.
Loading the graph
Open full-size workflow previewFiles in this workflow
- Output
- 3D
- Author
- Author unavailable
Requires custom nodes
- Reading the workflow
Use this workflow from code
Generated from the workflow graph and inputs when possible; stored examples are shown otherwise. Review credentials and endpoints before running code, which may incur charges.
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
Needs a paid Cloud plan and credits.
# 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": "flux-2-klein-base-9b_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"3": {
"class_type": "BlockSparseAttention",
"inputs": {
"dense_blocks": "",
"end_percent": 1,
"extra_tokens": 256,
"min_tokens": 12288,
"model": [
"1",
0
],
"selection": "sla",
"selection.keep_percent": 20,
"sink_conditioning": "exact_kv_and_rows",
"start_percent": 0,
"verbose": False
},
"_meta": {
"title": "Model Sparse Attention"
}
},
"4": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "ultratex_flux2_klein_9b_albedo_lora_bf16.safetensors",
"model": [
"105",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"5": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "ultratex_flux2_klein_9b_metallic_roughness_lora_bf16.safetensors",
"model": [
"3",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"7": {
"class_type": "ConditioningLoader",
"inputs": {
"conditioning_name": "flux-2-klein-9b_empty_prompt.safetensors"
},
"_meta": {
"title": "Load Conditioning"
}
},
"8": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ultratex_flux2_vae_fp32.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"11": {
"class_type": "Get3DComponents",
"inputs": {
"model_3d": [
"234",
0
]
},
"_meta": {
"title": "Get 3D Components"
}
},
"13": {
"class_type": "RenderMesh",
"inputs": {
"background": "#ffffff",
"camera_info": [
"18",
0
],
"height": [
"233:90",
0
],
"mesh": [
"11",
0
],
"mode": "world normal",
"width": [
"233:90",
0
]
},
"_meta": {
"title": "Render Mesh"
}
},
"14": {
"class_type": "LoadImage",
"inputs": {
"image": "sir_frog.png"
},
"_meta": {
"title": "Load Image"
}
},
"16": {
"class_type": "UltraTexConditioning",
"inputs": {
"conditioning": [
"7",
0
],
"extra_views": "off",
"masks": [
"210",
0
],
"normals": [
"209",
0
],
"reference": [
"242",
0
],
"reference_mask": [
"202",
0
],
"vae": [
"8",
0
]
},
"_meta": {
"title": "UltraTex Conditioning"
}
},
"17": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 6,
"height": [
"233:90",
0
],
"width": [
"233:90",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"18": {
"class_type": "CreateCameraOrbit",
"inputs": {
"camera_info": [
"234",
2
],
"count": 4,
"pitch": 0,
"poles": "top and bottom",
"yaw": 360
},
"_meta": {
"title": "Create Camera Orbit"
}
},
"20": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"17",
0
],
"model": [
"4",
0
],
"negative": [
"16",
0
],
"positive": [
"16",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 1,
"steps": 4
},
"_meta": {
"title": "KSampler"
}
},
"21": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"20",
0
],
"vae": [
"8",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"22": {
"class_type": "BakeTextureFromViews",
"inputs": {
"blend_exponent": 4,
"camera_info": [
"18",
0
],
"fill_unseen": True,
"images": [
"21",
0
],
"mesh": [
"11",
0
],
"resolution": [
"233:93",
0
]
},
"_meta": {
"title": "Bake Texture From Views"
}
},
"60": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"17",
0
],
"model": [
"5",
0
],
"negative": [
"16",
0
],
"positive": [
"16",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 4,
"steps": 8
},
"_meta": {
"title": "KSampler"
}
},
"61": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"60",
0
],
"vae": [
"8",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"62": {
"class_type": "BakeTextureFromViews",
"inputs": {
"blend_exponent": 4,
"camera_info": [
"18",
0
],
"fill_unseen": True,
"images": [
"61",
0
],
"mesh": [
"11",
0
],
"resolution": [
"233:93",
0
]
},
"_meta": {
"title": "Bake Texture From Views"
}
},
"80": {
"class_type": "ApplyTextureToMesh",
"inputs": {
"base_color": [
"228",
0
],
"mesh": [
"11",
0
],
"metallic": [
"231",
0
],
"roughness": [
"230",
0
]
},
"_meta": {
"title": "Apply Texture to Mesh"
}
},
"81": {
"class_type": "SaveGLB",
"inputs": {
"filename_prefix": "3d/ultratex_texture_3d_model",
"mesh": [
"80",
0
]
},
"_meta": {
"title": "Save 3D Model"
}
},
"105": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "flux-2-klein-9b_distill_lora_avg_rank_345_bf16.safetensors",
"model": [
"3",
0
],
"strength_model": 0.5
},
"_meta": {
"title": "Load LoRA"
}
},
"200": {
"class_type": "RemoveBackground",
"inputs": {
"bg_removal_model": [
"201",
0
],
"image": [
"242",
0
]
},
"_meta": {
"title": "Remove Background"
}
},
"201": {
"class_type": "LoadBackgroundRemovalModel",
"inputs": {
"bg_removal_name": "birefnet.safetensors"
},
"_meta": {
"title": "Load Background Removal Model"
}
},
"202": {
"class_type": "MaskPreview",
"inputs": {
"mask": [
"200",
0
]
},
"_meta": {
"title": "Preview Mask"
}
},
"209": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"13",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"210": {
"class_type": "MaskPreview",
"inputs": {
"mask": [
"13",
1
]
},
"_meta": {
"title": "Preview Mask"
}
},
"223": {
"class_type": "SplitImageChannels",
"inputs": {
"image": [
"62",
0
]
},
"_meta": {
"title": "Split Image Channels"
}
},
"228": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "3d/ultratex_texture_3d_model_albedo",
"format": "png",
"format.bit_depth": "8-bit",
"format.channels": "auto",
"format.input_color_space": "sRGB",
"images": [
"22",
0
]
},
"_meta": {
"title": "Save Albedo"
}
},
"230": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "3d/ultratex_texture_3d_model_roughness",
"format": "png",
"format.bit_depth": "8-bit",
"format.channels": "grayscale (1 channel)",
"format.input_color_space": "sRGB",
"images": [
"223",
1
]
},
"_meta": {
"title": "Save Roughness"
}
},
"231": {
"class_type": "SaveImageAdvanced",
"inputs": {
"filename_prefix": "3d/ultratex_texture_3d_model_metallic",
"format": "png",
"format.bit_depth": "8-bit",
"format.channels": "grayscale (1 channel)",
"format.input_color_space": "sRGB",
"images": [
"223",
2
]
},
"_meta": {
"title": "Save Metallic"
}
},
"234": {
"class_type": "Load3DAdvanced",
"inputs": {
"height": [
"233:90",
0
],
"model_file": "sir_frog.obj",
"viewport_state": "",
"width": [
"233:90",
0
]
},
"_meta": {
"title": "Load 3D (Advanced)"
}
},
"242": {
"class_type": "ResizeAndPadImage",
"inputs": {
"image": [
"14",
0
],
"interpolation": "area",
"padding_color": "white",
"target_height": [
"233:90",
0
],
"target_width": [
"233:90",
0
]
},
"_meta": {
"title": "Resize And Pad Image"
}
},
"233:90": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1024
},
"_meta": {
"title": "Rendered Mesh Resolution"
}
},
"233:93": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4096
},
"_meta": {
"title": "Texture Resolution"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)Related workflows
- Hunyuan3D
HunYuan3D: Text to Model
- Hunyuan3D, Tencent
HY 3D 2.0 MV
- Hunyuan3D
HY 3D: Image to Model
- IIdol, TripoSplat
Idol: Image to Gaussian Splat
- Meshy
Meshy T2.5: Image to Model (Smart Topology)
- Meshy
Meshy T2.5: Text to Model (Smart Topology)
- Meshy
Meshy: Image to Relief
- MMoGe
MoGe: Panorama to Mesh
- MMoGe
MoGe: Perspective Geometry Estimation
- RRodin
Rodin Gen2.5: Image to Model
- RRodin
Rodin Gen2.5: Text to Model
- SSAM 3D Body
SAM 3D Body: 3D Human Mesh Extraction From Video