Nodes/Comfyroll Studio/πŸ”’ CR Gradient Integer
ComfyUI Node Runs on cloud

πŸ”’ CR Gradient Integer

Ramp a Whole Number Across an Animation

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,296
πŸ”’ CR Gradient Integer
    • INT
    • show_help
    β—„start_value1β–Ί
    β—„end_value1β–Ί
    β—„start_frame0β–Ί
    β—„frame_duration1β–Ί
    β—„current_frame0β–Ί
    β—„gradient_profileβ–Ύβ–Ί

    CR Gradient Integer is the whole-number version of Comfyroll's ramp node: instead of a smooth float, it hands you an interpolated INT for whatever frame you're currently rendering - useful for anything that needs a clean integer rather than a fraction, like a pixel dimension, a batch size, or a step count that grows across an animation.

    How it works. Set a start_value and end_value, a start_frame and frame_duration to define the window, and feed it current_frame from whatever's driving your animation loop. It figures out how far into that window the current frame is and returns the interpolated integer for that point - start_value at the beginning of the window, end_value at the end. The gradient_profile selector controls the interpolation curve; the option exposed in the schema is Lerp, plain linear interpolation, so expect a straight ramp rather than an eased one.

    Why integer matters here. A lot of the things you'd want to animate genuinely need to land on whole numbers - image width and height (especially since most VAEs require dimensions divisible by 8), a step count for the sampler, a frame count, an index into a list. Feeding a float into a socket that expects an integer either gets silently truncated somewhere or just errors, so having a dedicated integer version of the ramp node avoids that entirely rather than making you remember to floor the float version's output every time.

    Where it fits. This is one of Comfyroll's animation-scheduling nodes, built for the manual-keyframe style of animating a Stable Diffusion checkpoint frame by frame - the pattern that dominated before native video models handled motion for you. You compute a fresh value for every frame based on where it sits on a timeline instead of hardcoding a constant, and CR Gradient Integer is the pure-math piece that does that computation. Its float sibling, CR Gradient Float, does the identical job when you need fractional precision instead.

    Inputs and output that matter. start_value / end_value (the two ends of the ramp), start_frame / frame_duration (the window), current_frame (where you are), gradient_profile (Lerp). Output is a single INT, plus the standard show_help string with a link to the wiki.

    Install. ComfyUI Manager: search "Comfyroll Studio", install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, restart. No models needed - this is pure logic.

    Troubleshooting. Same lesson as its float sibling: this node is only as good as what you wire into current_frame. If the value never changes across your run, it's almost always because current_frame isn't actually connected to a live frame index. And the pack-wide caveat still applies - Comfyroll registers everything from one shared file, and a broken import anywhere in the pack (a real, documented failure mode on r/comfyui, showing up as Failed to load Graphics nodes / Failed to load Utility nodes) takes every Comfyroll node with it. If nodes go missing after install, a clean re-clone beats chasing pip.

    Category🧩 Comfyroll Studio/πŸŽ₯ Animation/πŸ”’ Interpolate

    Inputs (6)

    NameTypeDefaultDescription
    start_valueINT10–9999β€”
    end_valueINT10–9999β€”
    start_frameINT00–9999β€”
    frame_durationINT10–9999β€”
    current_frameINT00–9999β€”
    gradient_profileCOMBO1 options: Lerp

    Outputs (2)

    NameTypeDescription
    INTINTβ€”
    show_helpSTRINGβ€”