ComfyUI Extension: ComfyUI-curved_weight_schedule
Custom Node for ComfyUI that allows you set a weighted curve to your ControlNet giving you more control over the weight of the model over the course of generation.
Custom Nodes (0)
README
ComfyUI Curved Weight Schedule
Advanced ControlNet scheduling and regional prompting nodes for ComfyUI. Control your ControlNet strength across time and space with precision and visual feedback.
π Features
- Curved Timestep Keyframes: Schedule ControlNet strength across generation steps with 14 different curve types
- Visual Feedback: Real-time graph preview showing your strength curve
- Multi-Mask Strength Combiner: Apply different ControlNet strengths to different regions of your image
- Regional Prompting: Use different text prompts for different masked areas
- Multiple Blend Modes: Max, Add, Multiply, and Average for flexible mask combination
π¦ Installation
-
Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
-
Clone this repository:
git clone https://github.com/diffussy69/comfyui-curved_weight_schedule.git
-
Install dependencies (if not already installed):
pip install matplotlib pillow numpy torch
-
Restart ComfyUI
The nodes will appear in:
conditioning/controlnet
β Curved Timestep Keyframesmask
β Multi-Mask Strength Combinerconditioning
β Regional Prompting
π― Node Overview
1. Curved Timestep Keyframes
Control ControlNet strength across generation steps using mathematical curves.
Key Parameters:
num_keyframes
: Number of control points (2-100)start_percent
/end_percent
: When to start/stop the curve (0.0-1.0)start_strength
/end_strength
: Strength values at start and endcurve_type
: Shape of the strength transitioncurve_param
: Controls transition speed/steepness
Available Curve Types:
strong_to_weak
: Start with high control, gradually releaseweak_to_strong
: Build up control over timelinear
: Straight line transitionease_in
/ease_out
/ease_in_out
: Smooth acceleration curvesbell_curve
: Strong in middle, weak at endsreverse_bell
: Weak in middle, strong at endsexponential_up
/exponential_down
: Dramatic transitionssine_wave
: Oscillating control (experimental)bounce
: Bouncing effectcustom_bezier
: Customizable bezier curve
Outputs:
TIMESTEP_KF
: Connect to Apply Advanced ControlNet'stimestep_kf
inputcurve_graph
: Visual preview (connect to Preview Image)
2. Multi-Mask Strength Combiner
Combine up to 5 separate masks with different ControlNet strengths.
Key Parameters:
base_strength
: Global multiplier for all masksmask_X
: Individual mask inputs (1-5)mask_X_strength
: Strength multiplier for each maskblend_mode
: How overlapping masks combinenormalize_output
: Clamp result to [0,1]
Blend Modes:
max
: Takes highest strength (best for separate regions)add
: Adds strengths together (for layering)multiply
: Multiplies strengths (for soft effects)average
: Averages all strengths (for smooth blending)
Output:
combined_mask
: Connect to Apply Advanced ControlNet'smask_optional
input
3. Regional Prompting
Apply different text prompts to different regions of your image.
Key Parameters:
clip
: Your CLIP modelbase_positive
: Base prompt applied to entire imageregion_X_mask
: Mask for each region (1-5)region_X_prompt
: Text prompt for that regionregion_X_strength
: How strongly the prompt affects the region
Output:
conditioning
: Connect to KSampler'spositive
input
π‘ Usage Examples
Example 1: Composition Lock (Strong Start, Fade Out)
Lock in composition early, then let the model add details freely.
Workflow:
βββββββββββββββββββ
β Load ControlNet β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββββββββββββ
β Curved Timestep Keyframes β
β - curve_type: strong_to_weak
β - start_percent: 0.0
β - end_percent: 0.4
β - start_strength: 1.0
β - end_strength: 0.1
β - curve_param: 3.0
ββββββββββ¬βββββββββββββββββββ
β
ββββββββββΌβββββββββββββββββββ
β Apply Advanced ControlNet β
β (timestep_kf input) β
βββββββββββββββββββββββββββββ
Result: ControlNet strongly guides early steps (structure), then releases control by 40% for creative details.
Example 2: Regional Control with Different Strengths
Apply ControlNet more strongly to some areas than others.
Workflow:
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Mountains β β Flowers β β Sky β
β Mask β β Mask β β Mask β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β
βββββββββββββΌβββββββββββββββ
β Multi-Mask Strength β
β Combiner β
β - mask_1_strength: 1.5 β (mountains - high)
β - mask_2_strength: 0.4 β (flowers - low)
β - mask_3_strength: 0.8 β (sky - medium)
β - blend_mode: max β
βββββββββββββ¬βββββββββββββββ
β
βββββββββββββΌβββββββββββββββ
β Apply Advanced ControlNetβ
β (mask_optional input) β
ββββββββββββββββββββββββββββ
Result: Mountains follow reference closely (1.5x), flowers have creative freedom (0.4x), sky is moderately guided (0.8x).
Example 3: Regional Prompting with Different Descriptions
Use different text prompts for different regions.
Workflow:
ββββββββββββββββ
β CLIP Model β
ββββββββ¬ββββββββ
β
ββββββββΌβββββββββββββββββββββββββ
β Regional Prompting β
β - base_positive: β
β "masterpiece, photorealistic"β
β β
β - region_1_mask: mountains β
β - region_1_prompt: β
β "snowy peaks, dramatic" β
β - region_1_strength: 1.2 β
β β
β - region_2_mask: flowers β
β - region_2_prompt: β
β "wildflowers, soft bokeh" β
β - region_2_strength: 1.0 β
βββββββββββββ¬ββββββββββββββββββββ
β
βββββββββΌβββββββββ
β KSampler β
β (positive) β
ββββββββββββββββββ
Result: Mountains get "snowy peaks" style, flowers get "wildflowers" style, with base quality tags applied everywhere.
Example 4: Ultimate Control (All Three Nodes Combined)
Combine timestep curves + regional ControlNet strengths + regional prompts.
Workflow:
βββββββββββββββ
β CLIP Model β
ββββββββ¬βββββββ
β
ββββββββββββββββΌββββββββββββββββββ
β Regional Prompting β
β - Different prompts per region β
ββββββββββββ¬ββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β β
βββββββββββββββΌβββββββ ββββββββββΌββββββββββββββ
β KSampler β β Curved Timestep β
β (positive input) β β Keyframes β
ββββββββββββββββββββββ β - Strength over time β
ββββββββββ¬ββββββββββββββ
β
βββββββββββββββββββββββββββ€
β β
βββββββββββββββΌβββββββββββββββ βββββββΌβββββββββββββββββββ
β Multi-Mask Strength β β Apply Advanced β
β Combiner βββββ ControlNet β
β - Different strengths β β - timestep_kf β
β per region β β - mask_optional β
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
Result:
- Different prompts per region (mountains, flowers, sky)
- Different ControlNet strengths per region (strong, medium, weak)
- Strength fades over time (starts strong, ends weak)
- Maximum creative control! π¨
π¨ Practical Tips
Curve Selection Guide
For Composition Control:
strong_to_weak
withcurve_param=2.5-4.0
β Lock composition early, release later- Set
end_percent=0.3-0.5
β Only control first 30-50% of generation
For Detail Refinement:
weak_to_strong
withcurve_param=2.0
β Let model generate freely, then guide details- Set
start_percent=0.5
β Only apply ControlNet in second half
For Style Consistency:
bell_curve
withcurve_param=2.0-3.0
β Strong guidance during structure formation- Weak at start/end for creative freedom
For Experimental Effects:
sine_wave
β Oscillating control (wild results!)bounce
β Rhythmic control variations
Mask Painting Tips
- Paint each region as a separate mask - don't worry about opacity
- Use full opacity - the strength settings control the effect
- Allow small overlaps - use
blend_mode=max
to handle them - Test one region at a time - easier to dial in individual strengths
Regional Prompting Best Practices
Base Prompt:
- Use for universal quality tags: "masterpiece, high quality, detailed"
- Avoid specific objects/subjects
Regional Prompts:
- Be specific about what's in that region
- Include style/lighting/atmosphere for that area
- Can include negative concepts if needed
Strength Values:
- Start at 1.0 for all regions
- Increase if a region isn't responding (1.2-1.5)
- Decrease if a region is overpowering others (0.6-0.8)
π Troubleshooting
Issue: Graph not showing
- Solution: Make sure matplotlib is installed:
pip install matplotlib
- Set
show_graph=false
if you don't need it
Issue: Masks not affecting output
- Solution:
- Check that masks are actually painted (not empty)
- Verify mask is connected to correct input
- Try increasing strength values
- Enable
show_debug=true
to see what the node is processing
Issue: Regional prompts bleeding into each other
- Solution:
- Make sure masks don't overlap
- Use more specific prompts
- Adjust region strength values
Issue: ControlNet effect too strong/weak everywhere
- Solution:
- Adjust
base_strength
in Multi-Mask Combiner - Check
strength
value on Apply Advanced ControlNet node - Verify
start_strength
andend_strength
values in Curved Timestep Keyframes
- Adjust
π Requirements
- ComfyUI
- ComfyUI-Advanced-ControlNet
- Python packages:
matplotlib
,pillow
,numpy
,torch
π€ Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new curve types
- Request features
- Submit pull requests
π License
MIT License - feel free to use and modify!
π Credits
Created with assistance from Claude (Anthropic). Special thanks to the ComfyUI and Advanced ControlNet communities.
Enjoy creating with precise control! π¨β¨
If you find this useful, consider starring the repo and sharing your creations!