Nodes/rknn-lcm-client-comfyui/RKNN LCM Generate (HTTP)
ComfyUI Node

RKNN LCM Generate (HTTP)

Text-to-image without your GPU — offloaded to a $130 Rockchip board

By Mario5Gray·Created 8 months ago·Updated 8 months ago· 0
RKNN LCM Generate (HTTP)
    • image
    • info
    api_baseshttp://node2:4200
    prompta cinematic photograph of a futuristic city at sunset
    size512x512
    steps4
    cfg1.0
    seed-1
    superres_magnitude0
    timeout_s120

    Let's get the misleading part out of the way first: this node generates nothing. The "Generate" in the name is doing a lot of work. RKNN LCM Generate is a pure HTTP client - it takes your prompt, ships it over the wire to a FastAPI server running SD 1.5 LCM on a Rockchip RK3588 (or RK356x) NPU, and turns the PNG that comes back into a normal ComfyUI IMAGE tensor. No model loading, no sampler, no CUDA, no local inference at all. The README calls these "remote render nodes," which is exactly right.

    So why reach for it? Because you own one of those little ARM boards. The server behind this node is a fork of the project that hit r/StableDiffusion in late 2024: a ~$130 RK3588 SBC running SD1.5 LCM entirely on its NPU, around 30 seconds per 512x512 image at 4 steps using ~5.6GB of RAM. Not fast, not pretty-looking by desktop standards, but it's Stable Diffusion in a Raspberry-Pi-sized package that sips watts and costs pocket money. People build headless fleets of these behind HAProxy and fire prompts at them. This node is how your ComfyUI talks to that fleet.

    How it works

    The mechanism is dead simple (you can read all of it in nodes.py). You give it one or more API base URLs, separated by ; or ,. It round-robins through them on each run - with multiple boxes, each call hits the next one, which is how the multi-node load balancing works. It POSTs a JSON body to {base}/generate containing your prompt, size, num_inference_steps, guidance_scale, seed, and a superres flag, waits for the PNG bytes, converts them to a B,H,W,C float tensor, and reads X-Seed, X-SuperRes, X-SR-Passes, and X-LCM-Backend response headers to build the info string.

    The inputs that matter

    Only a few of the eight will ever get touched:

    • api_bases - the default http://node2:4200 is a placeholder straight out of someone's homelab. This is the first thing you'll change, and honestly it should be renamed. Point it at your RK3588 box.
    • steps (default 4) and cfg (default 1.0) - this is LCM, so the rules are the opposite of normal SD. Keep steps in the 4–8 range and CFG down around 1–2. The defaults are already sane; don't "fix" them.
    • seed - -1 means random, and it's the only sensible value unless you're comparing outputs.
    • superres_magnitude - 0 is off; 1–4 asks the server to run that many super-resolution passes as a post-process. Note the server may clamp: the node's own comments say the backend currently accepts 1–3.
    • timeout_s (default 120) - fine for one generation, but bump it if you're stacking SR passes on a big image; the NPU is not quick.

    Outputs

    Two. image is the generated IMAGE tensor - wire it to a Save Image or Preview like you would any generation. info is a STRING with the backend, seed, SR status/passes, and round-trip time. ComfyUI doesn't display strings by default, so hook it into a text-display node if you want to see it.

    Install

    ComfyUI Manager → search rknn-lcm-client-comfyui - or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Mario5Gray/rknn-lcm-client-comfyui
    # restart ComfyUI
    

    The plugin's own dependencies are laughably light - just requests, pillow, numpy. Don't be fooled into thinking that's the whole story. The heavy stuff (RKNN-Toolkit2, the RKNN-converted ONNX models) lives on the server device, not in ComfyUI, and installing this node does not install or configure the server. You'll need Mario5Gray's separate Stable-Diffusion-1.5-LCM-ONNX-RKNN2 repo running somewhere reachable.

    Common issues

    • Everything is a connection error. If nothing's listening at your api_bases URL, the node just fails the request. Check the server first - the node is only a phone line.
    • Output quality looks off. Rockchip's RKNN quantization historically degraded images badly; that was fixed in RKNN-Toolkit2 v2.3.0. If your server's output looks washed out, verify the toolkit version on the board, not in ComfyUI.
    • Unexpected SR results. If the server clamps your magnitude, the info string's passes= tells you what actually ran.
    • Don't expect realtime. 30 seconds a pop on a 3588 makes this a batch/background pipeline tool, not an interactive one. If you want instant previews, a local LCM on your GPU is still the answer.
    Categoryrknn/lcm

    Inputs (8)

    NameTypeDefaultDescription
    api_basesSTRINGhttp://node2:4200
    promptSTRINGa cinematic photograph of a futuristic city at sunset
    sizeCOMBO512x5125 options: 256x256, 384x384, 512x512, 640x360, 640x384
    stepsINT41–50
    cfgFLOAT1.00–20
    seedINT-1-1–2147483647
    superres_magnitudeINT00–4
    timeout_sFLOAT1201–600

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    infoSTRING