Nodes/qq-nodes-comfyui/Axis To Float
ComfyUI Node

Axis To Float

The CFG-sweep converter, under its older spelling

By kenjiqq·Created 3 years ago·Updated about a year ago· 76
Axis To Float
  • axis
  • FLOAT

Axis To Float is the same converter as Axis To FLOAT - the pack's node that takes an AXIS_VALUE from XY Grid Helper and re-declares it as a float so you can wire a grid row or column into a decimal parameter. "Axis To Float" and "Axis To FLOAT" are one node; the two spellings just got picked up by node listings at different points in the pack's life. If you searched for this, what you're looking for is the float converter, and here's everything that matters about it.

The reason you want it: the classic grid is prompt × CFG. CFG is a float. The grid hands you an unknown-type AXIS_VALUE. ComfyUI refuses to connect unknown types to a FLOAT socket. Axis To Float makes the connection legal, and the value passes through untouched.

What it does

  • axis (required) - the AXIS_VALUE, usually the row_value or column_value from XY Grid Helper (or from Any List Iterator if you're stepping a list by hand).
  • FLOAT (output) - the same value, typed.

That's the whole interface. There's no conversion arithmetic - the converter's job is type declaration, and whatever your list actually holds is what arrives at the sampler.

The one rule that saves you an hour

The value must already be a float at the source. Three ways people get burned:

  1. Text Splitter lists hold strings. Splitting "6,7,8" gives you "6", "7", "8" - strings. The converter passes a string through; the sampler either errors or treats it as garbage.
  2. Ints stay ints. A list built from 6, 7, 8 ints stays integer-typed. Fine for CFG in most samplers, but if you need 6.5, you need an actual float in the list.
  3. The number of decimal places is on you. Grid labels come from whatever the list holds - 6.0 labels as "6.0", 6 labels as "6".

Build numeric axes with Any List using real floats, or from a file where each line is a proper number. Then the converter just works.

Installing it

Part of qq-nodes-comfyui:

cd ComfyUI/custom_nodes
git clone https://github.com/kenjiqq/qq-nodes-comfyui

Restart, or install qq-nodes-comfyui via ComfyUI Manager. Under the pack's QQNodes/XYGrid family. For custom converter types beyond the stock set (STRING, MODEL, INT, NUMBER, FLOAT, BOOLEAN, VAE, CLIP), add your type to custom-axis-config.json and restart.

CategoryQQNodes/XYGrid

Inputs (1)

NameTypeDefaultDescription
axisAXIS_VALUE

Outputs (1)

NameTypeDescription
FLOATFLOAT