Nuke Constant
Generate a solid color image with real alpha control
- IMAGE
Sometimes you need a rectangle of pure color, and you need it now, with exactly the right RGBA values. NukeConstant is the ComfyUI version of Nuke's Constant node: a generator with no image input that outputs a solid-color image at whatever size and color you ask for. It's the most boring node in the pack, and that's its superpower - a boring, predictable color reference is exactly what a lot of pipelines need.
You'll find it useful more often than you'd think. Need a background to composite a foreground over without loading an image file? This. Need to test whether your save pipeline preserves a specific color value exactly? This. Need a neutral mid-gray frame to check a grade? This. It's also the building block for mockups - put a logo render over a Constant background instead of hunting for a placeholder image.
How it works
It builds a tensor of the given width and height filled with the red, green, blue, and alpha values (each 0 to 1). Nothing more. The one decision that matters: output_alpha. With it off (default), you get a plain RGB fill. Turn it on and the output carries an RGBA channel with the alpha you set - which is what you want if this color is going to be composited with the alpha doing real work, like making a translucent color overlay.
The optional batch_size (1 to 64) generates multiple identical frames, handy when you're feeding a video workflow that expects a batch.
The inputs that matter
width/height- output size, up to 8192.red/green/blue- the fill color, 0 to 1 each. For a mid-gray test card: 0.5, 0.5, 0.5.alpha- the alpha value, 0 to 1 (default 1).output_alpha- whether to include an RGBA channel or just RGB.batch_size- number of identical frames.
Output is a single IMAGE.
Installing it
It's part of the Nuke Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/sumitchatterjee13/nuke-nodes-comfyui.git nuke-nodes
cd nuke-nodes
pip install -r requirements.txt
Or search "Nuke Nodes" in ComfyUI Manager and restart. It's under the Nuke category, pure PyTorch tensor generation - no dependencies beyond the pack itself.
Common issues
- The color looks different on screen than the values I set - your display is doing gamma/color management. This node outputs exactly the numeric values you set; how they look depends on your monitor. That's a feature: it's a reference, not a rendering.
- It's transparent when I expected it to be opaque - check
output_alphaandalpha. Ifoutput_alphais on andalphais low, you've built a translucent fill on purpose. - "Why do I need a solid color node?" - you'll know the first time a workflow needs a background and you don't want to save and load an image file. Also: gray test cards are the honest way to verify a grade.
It won't impress anyone, but when a workflow needs a color, this is the cleanest way to hand it one.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5121–8192 | — |
| height | INT | 5121–8192 | — |
| red | FLOAT | 0.000–1 | — |
| green | FLOAT | 0.000–1 | — |
| blue | FLOAT | 0.000–1 | — |
| alpha | FLOAT | 1.000–1 | — |
| output_alpha | BOOLEAN | false | — |
| batch_sizeopt | INT | 11–64 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |