ComfyUI Node

HTTP Form Text Item

A text form field, when you also care about its content type

By wawahuy·Created about a year ago·Updated 11 months ago· 14
HTTP Form Text Item
    • form_item
    nametext_field
    valuetext_value
    content_typetext/plain

    The pack ships two nodes that look nearly identical: HTTP Form Data Item and HTTP Form Text Item. Both produce a single text field for a multipart form. The difference is one optional input: this one lets you set the field's content_type. That's the entire point, and for most people that means "the version I'll use slightly less often."

    How it works

    Two required inputs, same as its plain sibling:

    • name - the form field name (defaults to text_field).
    • value - the field's content (defaults to text_value).

    Plus the one thing that justifies its existence:

    • content_type - defaults to text/plain. Set it to application/json for a field carrying JSON text, text/html for markup, whatever the API expects for that field.

    One output: form_item (HTTP_FORM_ITEM), feeding an HTTP Form Data slot. In the multipart body, this field goes into the data part with your chosen content type attached.

    When the extra knob actually matters

    Most multipart text fields are plain strings, and text/plain is fine - that's why HTTP Form Data Item exists as the no-frills default. You reach for this node when an API is strict about field content types: some endpoints want a JSON payload delivered as a form field with Content-Type: application/json, and sending it as text/plain gets you a 400. It's a small thing, but it's the difference between a form that works on one API and silently fails on another.

    Install

    ComfyUI Manager → search "ComfyUI-HTTP" → Install, restart. Manual:

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

    No models, no extra dependencies.

    Where people get burned

    The classic trap is overthinking it: the server's validation depends on the field name matching its schema, not on the content type you attach, so a content type of application/json won't fix a wrong field name. Set the name correctly first, then reach for this node only if the API explicitly complains about the field's content type. And as with every item node, an unplugged form_item output does nothing - it has to sit inside HTTP Form Data to reach the request.

    CategoryHTTP/Form Data

    Inputs (3)

    NameTypeDefaultDescription
    nameSTRINGtext_field
    valueSTRINGtext_value
    content_typeoptSTRINGtext/plain

    Outputs (1)

    NameTypeDescription
    form_itemHTTP_FORM_ITEM