Open Source Project

Nuke Nodes for ComfyUI

Bringing professional VFX compositing workflows to AI generation by implementing Foundry Nuke's industry-standard nodes in ComfyUI.

Overview

ComfyUI has revolutionized AI image generation workflows, but it lacks the professional compositing tools that VFX artists use daily in software like Foundry Nuke. This project bridges that gap by implementing a comprehensive collection of Nuke's most essential nodes directly in ComfyUI.

With over 26 merge operations and nodes for color grading, transformations, and blur effects, this package enables professional compositing techniques within AI generation pipelines, allowing artists to seamlessly integrate AI-generated content into production workflows.

The Challenge

VFX artists working with AI generation face a fundamental workflow disconnect:

  • ComfyUI excels at AI generation but lacks professional compositing operations
  • Nuke has industry-standard compositing tools but no native AI generation
  • Artists must export, composite externally, then re-importβ€”breaking the creative flow
  • Advanced operations like stencils, mattes, and color burn are unavailable

The solution: bring Nuke's professional compositing nodes directly into ComfyUI, creating a unified environment for AI generation and VFX compositing.

Implemented Node Categories

πŸ”—

Merge Nodes (26+ Operations)

Complete implementation of Nuke's merge operations, from standard compositing modes to advanced mathematical blends.

  • β†’Standard compositing: over, under, plus, minus
  • β†’Photographic blends: multiply, screen, overlay, soft light, hard light
  • β†’Color adjustments: color dodge, color burn, darken, lighten
  • β†’Mathematical operations: difference, exclusion, average, divide
  • β†’Channel operations: in, out, atop, xor, mask, stencil, matte
  • β†’Mix slider for blend amount control
🎨

Grade Nodes

Professional color correction and grading tools matching Nuke's workflow.

  • β†’Lift, gamma, gain controls for precise color grading
  • β†’Multiply and offset adjustments
  • β†’Individual RGB channel control
  • β†’Black and white point adjustments
  • β†’Saturation and contrast controls
πŸ”„

Transform Nodes

Spatial transformation operations for positioning and manipulating images.

  • β†’Translation (X, Y positioning)
  • β†’Rotation with center point control
  • β†’Scale (uniform and non-uniform)
  • β†’Skew transformations
  • β†’Center point adjustments
  • β†’Multiple interpolation methods
🌫️

Blur Nodes

Professional blur and softening operations.

  • β†’Gaussian blur with quality control
  • β†’Directional blur for motion effects
  • β†’Adjustable blur size and intensity
  • β†’Edge handling options
πŸ‘οΈ

Viewer & Utility Nodes

Essential tools for inspecting and managing composites.

  • β†’Image viewer with metadata display
  • β†’Alpha channel visualization
  • β†’Checkerboard background for transparency
  • β†’Image information display

Complete Merge Operations Reference

over
Standard
A composited over B (A on top of B)
under
Standard
A under B (equivalent to B over A)
plus
Mathematical
Additive blend: A + B
minus
Mathematical
Subtractive blend: B - A
multiply
Photographic
Darkening blend: A Γ— B
screen
Photographic
Lightening blend: 1 - (1-A)(1-B)
overlay
Photographic
Contrast blend combining multiply and screen
soft_light
Photographic
Gentle contrast adjustment
hard_light
Photographic
Strong contrast adjustment
color_dodge
Color
Brightens B based on A
color_burn
Color
Darkens B based on A
darken
Comparative
min(A, B)
lighten
Comparative
max(A, B)
difference
Mathematical
|A - B|
exclusion
Mathematical
A + B - 2Γ—AΓ—B
average
Mathematical
(A + B) / 2
divide
Mathematical
B / A
hypot
Mathematical
sqrt(AΒ² + BΒ²)
in
Matte
A masked by B's alpha
out
Matte
A where B is transparent
atop
Matte
A where B exists, B elsewhere
xor
Matte
A and B where they don't overlap
mask
Matte
A with alpha = AΞ± Γ— BΞ±
stencil
Matte
A where B is transparent
matte
Matte
B with A's alpha as matte
copy
Utility
Just A (direct copy)

Technical Implementation

Architecture

The project is structured as a modular Python package with separate files for each node category, ensuring maintainability and extensibility.

Project Structure

nuke-nodes-comfyui/
β”œβ”€β”€ merge_nodes.py # 26+ merge operations
β”œβ”€β”€ grade_nodes.py # Color grading tools
β”œβ”€β”€ transform_nodes.py # Spatial transformations
β”œβ”€β”€ blur_nodes.py # Blur operations
β”œβ”€β”€ viewer_nodes.py # Visualization tools
β”œβ”€β”€ utils.py # Shared utilities
└── __init__.py # Node registration

Key Design Decisions

Pixel-Perfect Accuracy

Each merge operation is implemented to match Nuke's exact mathematical formulation, ensuring identical results.

Alpha Channel Handling

Proper premultiplied alpha handling throughout, critical for professional compositing.

Performance Optimization

Efficient NumPy operations and optional OpenCV acceleration for real-time feedback.

Extensible Architecture

Clean, modular design makes it easy to add new nodes or customize existing ones.

Code Example: Merge Node Implementation

Simplified Merge Operation
class NukeMerge:
    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "image_a": ("IMAGE",),
                "image_b": ("IMAGE",),
                "operation": (MERGE_OPERATIONS,),
                "mix": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0}),
            }
        }
    
    def merge(self, image_a, image_b, operation, mix):
        # Convert to float32 for precision
        a = image_a.cpu().numpy().astype(np.float32)
        b = image_b.cpu().numpy().astype(np.float32)
        
        # Apply merge operation
        if operation == "over":
            result = a + b * (1 - a[..., 3:4])
        elif operation == "multiply":
            result = a * b
        elif operation == "screen":
            result = 1 - (1 - a) * (1 - b)
        # ... (26 total operations)
        
        # Apply mix
        result = b + (result - b) * mix
        
        return (torch.from_numpy(result),)

Installation & Usage

Installation

1. Clone into ComfyUI's custom_nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/sumitchatterjee13/nuke-nodes-comfyui
2. Install dependencies:
pip install opencv-python
3. Restart ComfyUI
Nodes will appear in the node menu under the "Nuke" category

Typical Workflow

1
Generate base image with Stable Diffusion/Flux
Use your preferred AI model to generate the base layer
2
Add elements with additional generations
Generate foreground elements, effects, or overlays
3
Composite with Nuke Merge nodes
Use 'over', 'screen', or other operations to combine layers
4
Color grade with Grade nodes
Adjust lift, gamma, gain for final look
5
Apply finishing touches
Add blur, transform, or other effects as needed

Professional Applications

🎨

AI-Enhanced Matte Painting

Generate multiple AI layers and composite them using professional techniquesβ€”screen for glows, multiply for shadows, color dodge for light effects.

🎬

VFX Plate Preparation

Prepare AI-generated elements for integration into Nuke workflows, using identical merge operations for predictable results.

✨

Concept Art Development

Rapidly iterate on concepts by generating and compositing multiple variations, using stencils and mattes for complex selections.

🌈

Look Development

Experiment with color grades and blending modes directly in the generation pipeline, matching established VFX color workflows.

Impact & Community

Project Highlights

  • β†’Open source MIT licensed, encouraging community contribution and adoption
  • β†’First comprehensive implementation of Nuke compositing in ComfyUI
  • β†’Bridges the gap between AI generation and professional VFX workflows
  • β†’Active development with community feedback and feature requests
  • β†’Comprehensive documentation and examples for ease of use

Why This Matters

By bringing Nuke's industry-standard compositing operations to ComfyUI, this project enables VFX professionals to integrate AI generation seamlessly into their existing workflows. Artists can now perform complex compositing tasks without leaving ComfyUI, maintaining creative momentum while leveraging familiar, battle-tested compositing techniques used in feature films worldwide.

Future Development

  • β†’
    Additional Nuke Nodes:ColorCorrect, Keyer, Despill, and other essential nodes
  • β†’
    Advanced Masking:Roto shapes and bezier curve support for precise selections
  • β†’
    3D Integration:Camera projection and 3D compositing operations
  • β†’
    Performance Optimization:GPU acceleration for real-time previews of complex composites
  • β†’
    Preset System:Save and load node configurations for quick setup

Technology Stack

PythonNumPyOpenCVPyTorchComfyUIPillow

Conclusion

Nuke Nodes for ComfyUI represents a significant step forward in making AI generation accessible to VFX professionals. By implementing industry-standard compositing operations in a pixel-perfect manner, this project eliminates the need to switch between tools, enabling artists to create complex, production-ready composites entirely within ComfyUI. As the bridge between cutting-edge AI and traditional VFX continues to strengthen, tools like this become essential for modern content creation pipelines.

Open Source Project by Sumit Chatterjee

MIT Licensed β€’ Community Contributions Welcome