ComfyUI Node Runs on cloud

RequestInputs

Unpack a JSON request straight into your ComfyUI graph

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
RequestInputs
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    • STRING
    values

    RequestInputs is the front door of the bmad nodes API subsystem, and it's refreshingly literal about its job: you give it a JSON object as a string, and it hands you back the values as separate STRING outputs. It's how a workflow designed for programmatic use receives its parameters - the caller stuffs a request body into the values widget, and your graph's inputs appear as plain strings ready to be parsed.

    Say your request body is:

    {"seed": "12345", "prompt": "a red house", "steps": "30"}
    

    That's a Python dict with three values, so the node fills its first three of thirty-two STRING outputs with 12345, a red house, and 30, in insertion order. That's the whole mechanism - json.loads(values).values(), no more. The 32 outputs are just there as a generous upper bound; the node emits as many values as your JSON has, and the rest go unused.

    Where it fits in the pack's API flow

    The bmad approach to API-driven generation is a small chain of nodes, all in this pack:

    CreateRequestMetadata (one per workflow - sets the request id)
            ↓
    RequestInputs (your JSON values land here)
            ↓
    String2Int / String2Float / dirty loaders (parse values into real types)
            ↓
    ...your generation graph...
            ↓
    Save Image (api) → SetRequestStateToComplete
    

    CreateRequestMetadata writes a status JSON to ComfyUI's output folder; the dirty loaders let you feed filenames as plain strings instead of picking from dropdowns; and SetRequestStateToComplete flips the status to "complete" so a caller polling the file knows the job finished. RequestInputs is the piece that turns the request's parameters into graph inputs.

    Honest take

    The pack's own author says it plainly in the README: the API nodes are barebones, and they won't document them because "there are better, more comprehensive and already documented solutions available." So if you're building a serious hosted service, you may well be better served by something purpose-built. But if you just need a small, self-contained way to drive a workflow from a JSON request - or you want to mock a request by pasting JSON into the widget while developing in the UI - this is a perfectly functional, dependency-free way to do it. Also useful for the round trip: the pack's Get Prompt node can dump a workflow with the RequestInputs values intact, so you can see exactly what a caller would send.

    Installing

    Ships in comfyui_bmad_nodes. ComfyUI Manager - search "comfyui_bmad_nodes" (or "Bmad Nodes") - install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bmad4ever/comfyui_bmad_nodes
    cd comfyui_bmad_nodes
    pip install -r requirements.txt
    

    Restart after. No model downloads. If your ComfyUI is old, the pack warns about the extension system - update ComfyUI and move on.

    One note: values expects a JSON object, not an array - the code reads json.loads(values).values(), so a JSON array will make it choke or do the wrong thing. Feed it an object and you're set.

    CategoryBmad/api

    Inputs (1)

    NameTypeDefaultDescription
    valuesSTRING

    Outputs (32)

    NameTypeDescription
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING
    STRINGSTRING