input float 输入浮点数
An input box that can become an API parameter — the workflow2api idea
- float
- int
- text
InputFloat (2lab) looks like the most boring node in the pack: a float input box. But look at the category it lives in - workflow2Api - and the extra two fields, and it starts to make sense. This node is built for the workflow-to-API pattern: a ComfyUI graph that gets turned into a callable endpoint where a few parameters are exposed to the person calling it, and the rest stay fixed.
On your own machine, it's just a convenient way to type a number once and route it around. In the author's intended design, it's a declared parameter - the thing an API consumer gets to change.
How it works
Three required inputs:
- float - the value, a
FLOATdefaulting to0. - desc - a short description. In the API mindset this is the label the caller sees ("CFG", "denoise strength"...). Locally it's a note to yourself about what the value means.
- export - a boolean, default
true. This is the switch that marks the parameter for export. Flip it off and the field stays in the workflow but drops out of the API surface.
Outputs mirror the conversion trick you see elsewhere in this pack: float, int (the value truncated to a whole number), and text (the value as a string). So one input node can feed a sampler, a resolution multiplier, and a text formatter at once without any extra converter nodes.
Honest caveat: the workflow2Api mechanics - what consumes export and desc, where the API surface actually materializes - are not documented in the pack. The README is one word long, so you're reading the schema. Locally, treat desc as a label and export as a reminder flag; they don't change how the node behaves on your graph. They only matter if you're using the pack's hosting flow.
Installing it
From the AI2lab/comfyUI-tool-2lab pack. ComfyUI Manager → search comfyUI-tool-2lab → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AI2lab/comfyUI-tool-2lab
No models, no dependencies worth mentioning - it's a pure-python helper. If you're just trying to feed one number into several typed inputs, it saves you a converter node; if you're building an exportable workflow, it's how you tell the API layer which float matters. Either way it's thirty seconds to install and zero ongoing cost.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| float | FLOAT | 0.000–18446744073709550000 | — |
| desc | STRING | — | |
| export | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |
| int | INT | — |
| text | STRING | — |