Scheduled CFG Guidance(ScheduledCFGGuidance)
From a technical implementation perspective, this node takes a model and positive/negative conditioning inputs, and allows the user to set a CFG value and the step range (expressed as a percentage) over which that value is effective.
Scheduled CFG Guidance
From a technical implementation perspective, the Scheduled CFG Guidance node receives a model along with positive and negative conditioning inputs. It allows users to set a CFG value and define the step range (expressed as a percentage) during which this value is active.
Scheduled CFG Guidance is a guider node designed to dynamically adjust the CFG (Classifier-Free Guidance) value during the image generation process. It allows users to apply different CFG strengths at specific stages of the sampling steps, enabling finer control over the alignment between the generated image and the prompt. This node aims to provide a flexible way to balance the creativity of the generated image and its adherence to the prompt.
Node Functionality
From a technical implementation perspective, the node receives a model along with positive and negative conditioning inputs. It allows users to set a CFG value and define the step range (expressed as a percentage) during which this value is active. Its core mechanism is that within the specified step percentage range (start_percent to end_percent), guidance is applied using the user-defined cfg value. Outside this range, a CFG value of 1.0 is automatically used, which typically means these steps are processed faster as they are not influenced by strong conditional guidance. Furthermore, the cfg parameter supports input as a single float (applied to all steps).
Node Parameter Description - Scheduled CFG Guidance
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
model | MODEL | Yes | - | - | model (Input Parameter): The base model used for image generation. This parameter defines the core neural network architecture and weights used in the generation process. |
positive | CONDITIONING | Yes | - | - | positive (Input Parameter): Positive conditioning input, typically containing text or image prompts describing features or content the generated image should possess. |
negative | CONDITIONING | Yes | - | - | negative (Input Parameter): Negative conditioning input, typically containing text prompts describing features or content the generated image should avoid. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
cfg | FLOAT | Yes | 6.0 | 0.0 - 100.0 (Step: 0.01) | cfg (Input Parameter): The strength value for Classifier-Free Guidance, ranging from 0.0 to 100.0 with a step size of 0.01. It is a single float value. |
start_percent | FLOAT | Yes | 0.0 | 0.0 - 1.0 (Step: 0.01) | start_percent (Input Parameter): The step percentage at which the dynamic CFG value starts to take effect, ranging from 0.0 to 1.0 with a step size of 0.01. |
end_percent | FLOAT | Yes | 1.0 | 0.0 - 1.0 (Step: 0.01) | end_percent (Input Parameter): The step percentage at which the dynamic CFG value stops taking effect, ranging from 0.0 to 1.0 with a step size of 0.01. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| GUIDER | GUIDER | GUIDER (Output Parameter): The configured dynamic CFG guider, which can be connected to a sampler node. |
Usage Scenarios
In practical applications, this node is commonly used in workflows that require staged control over image generation. For example, when generating a complex scene, a user might want to use a lower CFG value in the initial steps (e.g., the first 20%) to encourage diversity in composition and layout, then use a higher CFG value in the middle steps (e.g., 20% to 80%) to reinforce adherence to prompt details, and finally reduce the strength in the final steps to smooth out details. This helps achieve a better balance between creative freedom and prompt fidelity.
Notes
It is important to note that the valid range for start_percent and end_percent is 0.0 to 1.0, defining the relative time window during which the CFG schedule is active.
Scheduled CFG Guidance Node Source Code Link
The Scheduled CFG Guidance node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.