Nodes Browser

ComfyDeploy: How ControlAltAI Nodes works in ComfyUI?

What is ControlAltAI Nodes?

Quality of Life ComfyUI nodes starting with Flux Resolution Calculator and Flux Sampler.

How to install it in ComfyDeploy?

Head over to the machine page

  1. Click on the "Create a new machine" button
  2. Select the Edit build steps
  3. Add a new step -> Custom Node
  4. Search for ControlAltAI Nodes and select it
  5. Close the build step dialig and then click on the "Save" button to rebuild the machine

ComfyUI ControlAltAI Nodes

This repository contains custom nodes designed for the ComfyUI framework, focusing on quality-of-life improvements. These nodes aim to make tasks easier and more efficient. Two Flux nodes are available to enhance functionality and streamline workflows within ComfyUI.

Nodes

List of Nodes:

  • Flux
    • Flux Resolution Calculator
    • Flux Sampler
    • Flux Union ControlNet Apply
  • Logic
    • Boolean Basic
    • Boolean Reverse
    • Integer Settings
    • Choose Upscale Model
  • Image
    • Get Image Size & Ratio
    • Noise Plus Blend

Flux Resolution Calculator

The Flux Resolution Calculator is designed to determine the optimal image resolution for outputs generated using the Flux model, which is notably more oriented towards megapixels. Unlike traditional methods that rely on standard SDXL resolutions, this calculator operates based on user-specified megapixel inputs. Users can select their desired megapixel count, ranging from 0.1 to 2.0 megapixels, and aspect ratio. The calculator then provides the exact image dimensions necessary for optimal performance with the Flux model. This approach ensures that the generated images meet specific quality and size requirements tailored to the user's needs. Additionally, while the official limit is 2.0 megapixels, during testing, I have successfully generated images at higher resolutions, indicating the model's flexibility in accommodating various image dimensions without compromising quality.

  • Supported Megapixels: 0.1 MP, 1.0 MP, 2.0 MP, 2.1 MP, 2.2 MP, 2.3 MP, 2.4MP, 2.5MP
  • Note: Generations above 1 MP may appear slightly blurry, but resolutions of 3k+ have been successfully tested on the Flux1.Dev model.
  • Custom Ratio: Custom Ratio is now supported. Enable or Disable Custom Ratio and input any ratio. (Example: 4:9)

Flux Sampler

The Flux Sampler node combines the functionality of the CustomSamplerAdvance node and input nodes into a single, streamlined node.

  • CFG Setting: The CFG is fixed at 1.
  • Conditioning Input: Only positive conditioning is supported.
  • Compatibility: Only the samplers and schedulers compatible with the Flux model are included.
  • Latent Compatibility: Use SD3 Empty Latent Image only. The normal empty latent image node is not compatible.

ComfyUI Screenshot

Flux Union ControlNet Apply

The Flux Union ControlNet Apply node is an all-in-one node compatible with InstanX Union Pro ControlNet. It has been tested extensively with the union controlnet type and works as intended. You can combine two ControlNet Union units and get good results. Not recommended to combine more than two. The ControlNet is tested only on the Flux 1.Dev Model.

ComfyUI Screenshot

Recommended Settings:<br> strength: 0.15-0.65.<br> end percentage: 0.200 - 0.900.

Recommended PreProcessors:<br> Canny: Canny Edge (ControlNet Aux).<br> Tile: Tile (ControlNet Aux).<br> Depth: Depth Anything V2 Relative (ControlNet Aux).<br> Blue: Direct Input (Blurry Image) or Tile (ControlNet Aux).<br> Pose: DWPose Estimator (ControlNet Aux).<br> Gray: Image Desaturate (Comfy Essentials Custom Node).<br> Low Quality: Direct Input.

Results: (Canny and Depth Examples not included. They are straightforward.)<br><br> Pixel Low Resolution to High Resolution<br><br> ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

Photo Restoration<br><br> ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

Game Asset Low Resolution Upscale<br><br> ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

Blur to UnBlur<br><br> ComfyUI Screenshot

Re-Color<br><br> ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

ComfyUI Screenshot

YouTube tutorial Union ControlNet Usage: <a href="https://www.youtube.com/watch?v=4_1A5pQkJkg">Video Tutorial</a>

Shakker Labs & InstantX Flux ControlNet Union Pro Model Download: <a href="https://huggingface.co/Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro">Hugging Face Link</a>

Get Image Size & Ratio

This node is designed to get the image resolution in width, height, and ratio. The node can be further connected to the Flux Resolution Calculator. To do so, follow the following steps:

  • Right-click on the Flux Resolution Calculator -- > Convert widget to input -- > Convert custom_aspect_ratio to input.
  • Connect Ratio output to custom_aspect_ratio input.

ComfyUI Screenshot

Integer Setting

This node is designed to give output as a raw value of 1 or 2 integers. Enable = 2, Disable = 1.

Use case: This can be set up before a two-way switch, allowing workflow logical control to flow in one or the other direction. As of now, it only controls two logical flows. In the future, we will upgrade the node to support three or more logical switch flows.

ComfyUI Screenshot

Choose Upscale Model

A simple node that can be connected with a boolean logic. A true response will use upscale model 1, and a false response will use upscale model 2.

ComfyUI Screenshot

Noise Plus Blend

This node will generate a Gaussian blur noise based on the dimensions of the input image and will blend the noise into the entire image or only the mask region.

Issue: Generated faces/landscapes are realistic, but during upscale, the AI model smoothens the skin or texture, making it look plastic or adding smooth fine lines.

Solution: For upscaling, auto segment or manually mask the face or specified regions and add noise. Then, pass the blended image output to the K-Sampler and denoise at 0.20 - 0.50.

ComfyUI Screenshot

You can see the noise has been applied only to the face as per the mask. This will maintain the smooth bokeh and preserve the facial details during upscale. ComfyUI Screenshot

Denoise the image using Flux or SDXL sampler. Recommended sampler denoise: 0.10 - 0.50 ComfyUI Screenshot

Settings:<br> noise_scale: 0.30 - 0.50.<br> blend_opacity: 10-25.

If you find too many artifacts on the skin or other textures, reduce both values. Increase the values if upscaling output results in plastic, velvet-like smooth lines.

Best Setting for AI-generated Faces:<br> noise_scale: 0.40-0.50.<br> blend_opacity: 15-25.

Best Setting for AI-generated texture (landscapes):<br> noise_scale: 0.30.<br> blend_opacity: 12-15.

Results: Example 1<br> Without Noise Blend: ComfyUI Screenshot

With Noise Blend: ComfyUI Screenshot

Example 2<br> Without Noise Blend: ComfyUI Screenshot

With Noise Blend: ComfyUI Screenshot

Example 3<br> Without Noise Blend: ComfyUI Screenshot

With Noise Blend: ComfyUI Screenshot

Example 4<br> Without Noise Blend: ComfyUI Screenshot

With Noise Blend: ComfyUI Screenshot

YouTube ComfyUI Tutorials

We are a team of two and create extensive tutorials for ComfyUI. Check out our YouTube channel:</br> <a href="https://youtube.com/@controlaltai">ControlAltAI YouTube Tutorials</a>

Black Forest Labs AI

Black Forest Labs, a pioneering AI research organization, has developed the Flux model series, which includes the Flux1.[dev] and Flux1.[schnell] models. These models are designed to push the boundaries of image generation through advanced deep-learning techniques.

For more details on these models, their capabilities, and licensing information, you can visit the <a href="https://blackforestlabs.ai/">Black Forest Labs website</a>

License

This project is licensed under the MIT License.