Create USD Color
Hex picker in, typed USD color out
- color
- color
A color in ComfyUI is a hex string. A color in USD is a typed Color3f or Color4f value, and the two are not interchangeable when you're setting attributes directly. Create USD Color is the translation layer: you pick a color on a nice color swatch, it hands you a correctly-typed USD color value for the pack's attribute and scripting nodes to consume.
Where does this matter? If you're working through the high-level nodes - Apply USD Material's diffuse color, Create USD Light's light color - you don't need it; those nodes take a hex color themselves. But the moment you're down at the attribute level (Set/Get USD Attribute, the scripting node, or writing a primvars:displayColor directly), you need a value that's already a USD color type, and that's this node's whole job.
The inputs
- color - a hex color with an alpha channel, default
#ccccccff. Theffon the end is the alpha; you can also type a 6-digit hex and it getsffappended automatically. - color_type - the precision and component count, default
color3f:color3f/color3d/color3h(RGB, float/double/half) orcolor4f/color4d/color4h(RGBA). Choosecolor4*when the alpha matters (you're writing displayColor with opacity),color3*otherwise.
Output is a single USD_VALUE socket carrying the typed color.
How it works
Mechanically it's boring and reliable: the hex gets parsed into 0–1 float components (hex_to_rgba), and the value is wrapped in the right USD type (Gf.Vec3f/Vec4f/etc.). The USD_VALUE output is a small dict of {"data": ..., "type": ...}, which is the shape this pack's attribute-setting machinery expects - that's why the socket is labeled USD_VALUE rather than being a plain vector.
Install & caveats
Pack install, one time: ComfyUI Manager → search "ComfyUI-OpenUSD", or
cd ComfyUI/custom_nodes
git clone https://github.com/cjhosken/ComfyUI-OpenUSD
then restart. Deps: usd-core==26.5, numpy==2.5.0, trimesh.
Caveats: the USD_VALUE socket is pack-private - it plugs into this pack's attribute/scripting nodes and nowhere else. And keep the f/d/h suffixes honest: color3f is single-precision float, color3d is double, color3h is half - unless you're chasing a specific precision contract, color3f is the sensible default and half is, as with the other type nodes here, "labeled half" rather than a true memory win.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| color | COLOR | #ccccccff | — |
| color_type | COMBO | color3f | 6 options: color3f, color3d, color3h, color4f, color4d, color4h |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| color | USD_VALUE | — |