ComfyUI > Nodes > ComfyUI Cutoff

ComfyUI Extension: ComfyUI Cutoff

Repo Name

ComfyUI_Cutoff

Author
BlenderNeko (Account age: 532 days)
Nodes
View all nodes(4)
Latest Updated
2024-05-22
Github Stars
0.35K

How to Install ComfyUI Cutoff

Install this extension via the ComfyUI Manager by searching for ComfyUI Cutoff
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Cutoff in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ComfyUI Cutoff Description

ComfyUI Cutoff enhances text prompt control by offering custom nodes that refine and manage the effects of input prompts, ensuring more precise and tailored outcomes in the user interface.

ComfyUI Cutoff Introduction

ComfyUI_Cutoff is an extension designed to enhance the capabilities of the ComfyUI interface for Stable Diffusion. This extension allows you to precisely control how specific attributes in your text prompts influence the generated images. For example, if your prompt includes "a cute girl, white shirt with green tie, red shoes, blue hair, yellow eyes, pink skirt," ComfyUI_Cutoff lets you specify that "blue" should only affect "hair" and not "shoes," and "green" should only affect "tie" and not "skirt." This level of control can help you achieve more accurate and visually appealing results in your AI-generated art.

How ComfyUI Cutoff Works

When you input a text prompt into Stable Diffusion, the text is tokenized, and CLIP (Contrastive Language-Image Pretraining) creates a vector (embedding) for each token. For instance, in the prompt "blue hair, yellow eyes," some vectors will correspond to "blue hair" and others to "yellow eyes." However, CLIP sometimes struggles to correctly associate adjectives with the right nouns, leading to unintended color associations.

ComfyUI_Cutoff addresses this by masking out specific tokens and creating new embeddings without those tokens. By comparing the original and new embeddings, the extension identifies the direction to adjust the vectors so that each attribute affects only its intended target. This process isolates the influence of each attribute, ensuring that "blue" affects only "hair" and not "eyes," and so on.

ComfyUI Cutoff Features

Cutoff BasePrompt

This node takes the full original prompt and serves as the starting point for the cutoff process.

Cutoff Set Region

This node allows you to define specific regions of influence for target words. It includes the following inputs:

  • region_text: Specifies the part of the original prompt that the target words should affect. Multiple regions can be defined by listing each on a new line.
  • target_text: Lists the words to be masked off, separated by spaces. For sequences of words, use underscores (e.g., "a_series_of_connected_tokens"). To include underscores in the actual words, escape them (e.g., "the\_target\_tokens").
  • weight: Determines how strongly to isolate the vector for the target words.

Cutoff Regions To Conditioning

This node converts the base prompt and defined regions into a conditioning input for the rest of ComfyUI. It includes:

  • mask_token: The token used for masking. Defaults to <endoftext> if left blank.
  • strict_mask: When set to 0.0, target tokens affect areas outside their specified regions. When set to 1.0, target tokens affect only their own regions.
  • start_from_masked: When set to 0.0, the starting point is the original prompt. When set to 1.0, the starting point is the completely masked-off prompt.

Cutoff Regions To Conditioning (ADV)

This advanced node offers additional options for interpreting prompt weighting. More details can be found here.

ComfyUI Cutoff Models

Currently, ComfyUI_Cutoff does not introduce new models but enhances the functionality of existing Stable Diffusion models by providing more control over prompt attributes.

What's New with ComfyUI Cutoff

Recent Updates

  • SDXL Support: Improved compatibility with SDXL models.
  • Newer WebUI Support: Added support for the latest version of the WebUI.
  • Empty Targets Handling: Now skips empty targets to avoid errors.
  • Disable for Negative Prompt Option: Added an option to disable cutoff for negative prompts, enabled by default.
  • Accept Empty Prompts: Now accepts empty prompts without errors.

Troubleshooting ComfyUI Cutoff

Common Issues and Solutions

  • Corrupted Images: If the generated image appears corrupted, try adjusting the "Weight" value or changing the interpolation method to "SLerp" in the "Details" section.
  • Unexpected Attribute Influence: Ensure that the target words are correctly specified and that the regions are accurately defined.

Frequently Asked Questions

  • Why is my image not reflecting the specified attributes?
  • Double-check the target and region texts for any typos or incorrect formatting.
  • How do I make sure a color only affects a specific part of the image?
  • Use the Cutoff Set Region node to define the region and target texts accurately.

Learn More about ComfyUI Cutoff

For additional resources, tutorials, and community support, you can explore the following:

ComfyUI Cutoff Related Nodes

RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.