Nodes/ComfyUI-UltraTex/UltraTex Bake Texture
ComfyUI Node

UltraTex Bake Texture

Where six pretty pictures become one actual texture file

By visualbruno·Created 23 days ago·Updated 3 days ago· 46
UltraTex Bake Texture
  • prep
  • albedo_views
  • metallic_roughness_views
  • prep_2
  • albedo_views_2
  • metallic_roughness_views_2
  • trimesh
  • albedo_texture
  • preview
  • glb_path
  • model_3d
  • bake_state
◄texture_size4096►
◄filename_prefixUltraTex/mesh►
◄view_weight_power4.0►
◄best_view_mix0.50►
◄edge_feather_px6►
◄views_2_useall►
◄fusiontwo_band►
◄detail_sharpness32►
◄exposure_matchtrue►
◄hole_fillmesh►
◄views_2_weight0.60►

This is the node that gives you something you can use. Six views are a diffusion result; a GLB with a UV texture on it is an asset.

The job is back-projection, and it's the same problem texture-projection tools have solved badly for years: for every texel in the UV layout, work out which of the views can see the corresponding surface point, trust the ones that see it head-on, ignore the ones that don't, and blend. UltraTex's version is weighted by the cosine between the surface normal and the view direction, with occlusion handling so a sleeve doesn't get painted with the arm behind it.

The settings that matter

texture_size is the resolution of the baked map, default 4096 and allowed up to 8192. It's independent of the sampling resolution - you can sample at 1024 and still bake at 4096, which is a reasonable way to spend your time, since the low-frequency stuff survives the upscale and the second pass covers the detail.

view_weight_power (default 4) is the exponent in that cosine weighting: blend weight = cos(normal, view)^power. Higher = only near-perpendicular views count, which is sharper but emptier where nothing qualifies. Lower = smoother and mushier.

best_view_mix (default 0.5) is the blend between "average everything that can see this texel" and "just take the best view." At 0 you get a soft, safe blend; at 1 the sharpest single view wins and seams become visible. The default sits in the middle for a reason - the tooltip warns that cranking it gives you sharper output and more visible seams, and that's exactly what it does.

edge_feather_px (default 6) down-weights pixels near silhouettes and occlusion edges. Leave it alone; edges are where bad bake pixels come from.

filename_prefix defaults to UltraTex/mesh, and it's a template - the slash creates a subfolder in output. The node is an output node, so it always runs when the graph runs, which is worth remembering: you'll get a GLB whether you wanted one or not.

Inputs and outputs

Required: prep (the same one that fed the sampler), albedo_views (exactly six - the node raises if you hand it anything else), plus the settings above.

Optional, and this is where the good stuff lives:

  • metallic_roughness_views - six views from the MR LoRA. The bake writes an ORM texture: G = roughness, B = metallic, with R forced to 1 (occlusion, unused). That's the glTF convention, so your engine reads it correctly without remapping.
  • prep_2 + albedo_views_2 (+ metallic_roughness_views_2) - the second rig from UltraTex Rotate Rig and its views, baked into the same texture together with pass one. prep_2 has to come from the rotate node applied to the same prep - it compares vertices and UVs and refuses otherwise - and if you connect prep_2 without albedo_views_2 it errors rather than quietly doing half the job.
  • views_2_use picks which second-rig views get baked: all, front only, back only, front + back, or no top/bottom. This exists because of the rigid-elevation case, where the rolled side views are junk and you'd rather drop them than let them into the blend.

Outputs, in order:

  • trimesh - the textured mesh, in its original scale and position, so it drops back into whatever scene the untextured one came from.
  • albedo_texture - the baked map as an image, for inspecting in ComfyUI.
  • preview - unlit renders from eight azimuths. This is the honest look at your result, and it's what I'd check first: if you see seams here, no engine will hide them.
  • glb_path - a string, relative to the output folder. Useful for logging or feeding a filename downstream.
  • model_3d - the saved GLB as a FILE_3D_GLB, wired straight into Preview 3D to orbit it.
  • bake_state - textures plus per-texel confidence, and the input UltraTex Render Views wants if you decide after baking that you want a second pass.

On disk you get three files per run:

output/UltraTex/mesh_00001_.glb
output/UltraTex/mesh_00001__albedo.png
output/UltraTex/mesh_00001__orm.png    # only when MR views were baked

Install

Manager → ComfyUI-UltraTex, or:

cd ComfyUI/custom_nodes
git clone https://github.com/visualbruno/ComfyUI-UltraTex

Requirements: trimesh, moderngl, xatlas, scipy. No extra model files are needed here - the decoder, LoRA and diffusion weights are all upstream.

Where people get burned

  • model_3d comes back empty on older ComfyUI. The node builds that output from ComfyUI's newer 3D file type and sets it to None if the import isn't available. Nothing crashes; the output is just null. Use glb_path, or load the file with Load 3D.
  • White fringes along silhouettes. UltraTex sometimes draws its outline a few pixels inside the real one, leaving a white gap that used to bake in as white edging on sleeves and boots. The baker now drops near-white pixels in a thin band just inside each silhouette and extends view colours past the edges to compensate - but if you skipped the foreground VAE decoder, or your reference has a bright rim of its own, you'll still see traces.
  • UVs that don't match. Every "this doesn't line up" failure in the pack traces back to baking with a different prep than you sampled with, or re-exporting the mesh in between. Prep once, reuse the object.
  • 8192 texture size buys you file size, not detail. The maps come from 2K views; a 4K bake is already upsampling.
CategoryUltraTex

Inputs (17)

NameTypeDefaultDescription
prepULTRATEX_PREP—
albedo_viewsIMAGE—
texture_sizeINT4096512–8192—
filename_prefixSTRINGUltraTex/mesh—
view_weight_powerFLOAT4.00–16Blend weight = cos(normal, view)^power.
best_view_mixFLOAT0.500–10 = pure weighted blend, 1 = best view only (sharper, more visible seams).
edge_feather_pxFLOAT60–64Down-weight pixels near silhouettes / occlusion edges.
metallic_roughness_viewsoptIMAGEViews from the MR LoRA: G = roughness, B = metallic.
prep_2optULTRATEX_PREPExtra rig(s) baked together with the first: UltraTex Rotate Rig (one) or UltraTex Custom Rig (a list, one per group of 4 views).
albedo_views_2optIMAGEAlbedo views generated with prep_2 (one set of 6 per rig).
metallic_roughness_views_2optIMAGEMetallic-roughness views generated with prep_2 (one set of 6 per rig).
views_2_useoptCOMBOallWhich views of the second rig to bake (e.g. drop poor views). With elevation_mode 'rigid' and elevation != 0 only the front (> 0) or back (< 0) view is raised; the side views are rolled.
fusionoptCOMBOtwo_bandtwo_band: colours blended smoothly across views (low band) while fine detail comes from the best view with a continuous hand-over - no ghosting, no seam lines. legacy: previous 50% average + 50% best view.
detail_sharpnessoptFLOAT321–128two_band: how strongly the detail band prefers the best view ((q / q_max)^n). Higher = sharper, but view disagreements can show as seams.
exposure_matchoptBOOLEANtruetwo_band: per-view colour gains (+-15%) estimated on overlaps, front view anchored, to remove brightness seams.
hole_filloptCOMBOmeshTexels no view sees: mesh = smooth harmonic fill along the mesh surface (follows connectivity), nearest = average of the 4 nearest seen texels in 3D.
views_2_weightoptFLOAT0.600.1–1two_band: view-angle quality factor of the second-pass views. Below 1 a second-pass view paints a texel only where it sees it clearly better than the first pass (keeps the first pass crisp; a second pass at high denoise does not agree exactly with it). 1 = no preference.

Outputs (6)

NameTypeDescription
trimeshTRIMESHTextured trimesh (original scale and position).
albedo_textureIMAGEBaked albedo texture.
previewIMAGEUnlit renders from 8 azimuths.
glb_pathSTRINGGLB path relative to the output folder.
model_3dFILE_3D_GLBThe saved GLB as a 3D file: connect to Preview 3D.
bake_stateULTRATEX_BAKETextures + per-texel confidence, for UltraTex Render Views (second pass).