ComfyUI Node

ImageTransceiver

The live image-in node

By Charlweed·Created 2 years ago·Updated 3 months ago· 5
ImageTransceiver
    • IMAGE
    • MASK
    print_to_stream

    ImageTransceiver is the ComfyUI half of a two-project pipeline that lets an external image editor push images into a workflow in near real-time. The canonical pairing is GIMP: you paint, draw, or cut in GIMP, and every edit gets sent to ComfyUI, which re-runs your graph on the new image. Think "live img2img painting rig" - sketch a face in GIMP, have the sampler turn it into a rendered portrait while you keep refining the sketch.

    The name is not a lie, but it undersells the dependency. This node doesn't do anything by itself. It's the receiver; the transmitter is GimpComfyUI, a GIMP plugin by the same author that requires GIMP 2.99.18+ (a development release) or GIMP 3.0+. If you don't use GIMP, this node is not for you - it's a niche bridge for a niche workflow, with roughly zero community buzz to show for it. If you do live in GIMP and have wished your edits would flow straight into a ComfyUI graph, this is that bridge.

    How it works

    Under the hood it's a tiny local websocket server plus a cached image. When the node first loads, it starts a WebSocket server on localhost:8765 (with a 1 GB message ceiling, since you're shipping base64-encoded images over it). The GIMP client connects and streams base64 PNGs. Each incoming image is decoded to PIL, cached on a shared class-level singleton, and pushed to the browser via send_sync so the node's on-canvas preview updates live.

    When the workflow queues, flow_image turns that cached PIL image into a torch tensor - deliberately mirroring ComfyUI's own LoadImage code (EXIF transpose, RGB conversion, normalize to 0–1, add the batch dimension). A custom IS_CHANGED hashes the cached image's bytes, so the node forces a re-execute whenever the incoming image actually changes. That's what makes the loop feel live: edit in GIMP, auto-queue, new result.

    The inputs and outputs that matter

    The whole input side is one toggle, which tells you everything about how much this node wants from you:

    • print_to_stream (enable/disable) - a debug switch that prints the node's internal node_id message to the console. Set it to disable and forget it.

    The outputs are the part you wire into your graph:

    • IMAGE - the incoming image as a tensor. Feed it into a VAE Encode → KSampler chain for img2img (the README walks through exactly this, adapted from the ComfyUI img2img demo), or into anything else that accepts an IMAGE: ControlNet preprocessing, IPAdapter, you name it.
    • MASK - only meaningful if the incoming image has an alpha channel; then the alpha becomes the mask (inverted, same convention as LoadImage). With no alpha you get a blank 64×64 zero mask. Wire this into Set Latent Noise Mask if you're doing region-protected edits.

    Installing it

    Read this twice, because it's the trap of the pack. The README's official answer is: don't install this first. Install GimpComfyUI and run its installer - it downloads this repo and copies the right files into custom_nodes for you.

    If you're modifying the code or installing by hand, do not copy the whole repository into custom_nodes. The repo contains extra files that make ComfyUI print load errors. Only copy these, recursively, into custom_nodes/image_transceiver:

    js
    utilities
    __init__.py
    image_transceiver.py
    

    Dependencies are numpy, torch, Pillow, and websockets - all already present in a normal ComfyUI install, and there are no model files to download. The node is published to the Comfy registry, so ComfyUI Manager may find "ImageTransceiver", but a Manager git-clone lands the whole repo, which is exactly the failure mode above. The intended path is the GimpComfyUI installer.

    Common gotchas

    • The node alone does nothing. Until a client connects and sends an image, it holds a blank 1×1 white image. No GIMP client, no point.
    • The manual-copy trap: whole repo into custom_nodes → error messages on startup. Stick to the four items above, and delete any existing image_transceiver folder first.
    • GIMP version gate: 2.99.18+ or 3.0+ or the plugin won't run.
    • Port 8765 must be free, since that's where the WebSocket server binds.
    • It's alpha software - the author says so in plain terms in the README. Expect rough edges and don't build a production pipeline on it.

    For the img2img demo: set the seed to fixed so only your edits change the output, and remember that lower denoise means your painted image comes through more strongly.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    print_to_streamCOMBO2 options: enable, disable

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK