Nodes/comfyui-byokey/BYOKey Recraft Image
ComfyUI Node

BYOKey Recraft Image

The text-in-image specialist, 89 substyles deep

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Recraft Image
    • IMAGE
    api_key
    base_urlhttps://external.api.recraft.ai/v1
    prompt
    size1024x1024
    n1
    seed0
    stylerealistic_image
    substyleNone
    negative_prompt
    style_id

    Recraft is the "best image generator you never heard of" - a design-focused lab whose V3 model quietly tops leaderboards, with the best text-in-image rendering of the closed crop. This node is the bring-your-own-key way to drop it into a ComfyUI graph. No Comfy credit meter, no proxy: paste a Recraft key, get an IMAGE tensor out like any local sampler.

    How it works. A single POST to external.api.recraft.ai/v1/images/generations with your key as a Bearer token. The body mirrors Recraft's own request format field-for-field - prompt, size, n, style, substyle, negative prompt, style_id - and the node parses the response (preferring the data array, falling back to a single image), then decodes the PNG into a [1, H, W, C] torch tensor that plugs into standard image preview/save nodes. Synchronous and quick; no polling to babysit.

    The inputs that matter:

    • prompt - capped at 1000 characters and validated non-empty. Recraft is unusually good with text-in-image, so lean into that: quote the exact words you want rendered.
    • style - the four top-level families: realistic_image, digital_illustration, vector_illustration, logo_raster. This is the backbone of Recraft's whole identity.
    • substyle - 89 options underneath, like hdr, motion_blur, faded_nostalgia, evening_light. This is where Recraft earns its reputation; the palette here is far deeper than any other image API's. Just make sure the substyle matches the style family you picked.
    • style_id - a UUID from Recraft's Infinite Style Library (your own trained styles). Here's the trap: if the style id is a Vector art style, Recraft returns SVG, not a raster image, and this node expects a bitmap - the output will break. Use raster style ids only.
    • n - how many images in one call, 1 to 6. Recraft returns them as a batched tensor, so you get a stack of results for one round-trip. Handy for a quick grid.
    • size - 9 presets from 1024x1024 up to wide 1536x640 / tall 640x1536.
    • negative_prompt - supported and worth a sentence; Recraft honors it.

    When a style_id is set, Recraft ignores style/substyle entirely - the custom style takes over.

    Output: one IMAGE socket (tensor). Into a Save Image or Preview node like anything else.

    Install. The whole pack installs the same way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MeteorAndy/comfyui-byokey.git
    # restart ComfyUI; nodes under api/byokey/...
    

    No model files, no extra deps - just ComfyUI's bundled torch/aiohttp/PIL/numpy/av.

    Gotchas. The 1000-char prompt limit is real and enforced, so keep prompts tight. The Vector-style-returns-SVG footgun is the one that'll actually bite you. And it's a fresh pack with no community track record yet - the standing rule for anything that holds an API key applies: skim the source before you trust it.

    Categoryapi/byokey/image

    Inputs (10)

    NameTypeDefaultDescription
    api_keySTRING
    base_urlSTRINGhttps://external.api.recraft.ai/v1
    promptSTRINGPrompt for the image generation.
    sizeCOMBO1024x1024The size of the generated image.
    nINT11–6The number of images to generate.
    seedINT00–18446744073709550000Seed to determine if node should re-run; actual results are nondeterministic regardless of seed.
    styleoptCOMBOrealistic_imageStyle for image generation. Defaults to realistic_image.
    substyleoptCOMBONoneOptional substyle (must match the chosen style; 'None' for no substyle).
    negative_promptoptSTRINGAn optional text description of undesired elements on an image.
    style_idoptSTRINGOptional UUID of a style from Recraft's Infinite Style Library (do not use a Vector art style; it returns SVG).

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE