Nodes/ComfyUI-CozyGen/CozyGen Image Input
ComfyUI Node

CozyGen Image Input

How CozyGen Image Input gets a picture in

By gsusgg·Created about a year ago·Updated 11 months ago· 24
CozyGen Image Input
    • IMAGE
    • MASK
    param_nameImage Input
    image_filename

    CozyGen is a mobile-friendly web controller for your ComfyUI box: you build the graph on the desktop, then drive it from a browser at http://<your-comfyui-ip>:8188/cozygen. The original release only did text-to-image, and the author said so plainly. CozyGenImageInput is the update that fixed that - it's the piece that lets you feed a picture into a workflow from your phone, which turns a text-to-image controller into an img2img controller. It's how the pack's CozyGen_i2i_example.json and QWEN image-edit workflows work.

    The name undersells it a bit: it's less a "node that does work" and more a pipe that connects "the image you picked on your phone" to the rest of your graph.

    How it works

    There's no file dialog in the node graph. The front end uploads the image you pick (from your phone's gallery or camera) to CozyGen's /cozygen/upload_image endpoint, which saves it into ComfyUI's input directory with a UUID prefix so nothing collides. It returns the filename, the web UI writes it into this node's image_filename input, and the node's load_image reads it on the next queue run. The upload side also does a "smart resize" to keep the image inside roughly standard 1024×1024 territory while preserving aspect ratio - sensible, since phone photos are huge and diffusion models aren't fond of odd dimensions.

    It mimics ComfyUI's built-in LoadImage in the ways that matter, outputting:

    • IMAGE - the RGB tensor, ready for VAEEncode (img2img) or any image-consuming input.
    • MASK - if the source has an alpha channel, the alpha becomes the mask and RGB is kept; without alpha you get an all-white (fully opaque) mask, so it wires straight into inpainting nodes too.

    The inputs are just param_name (the web-page label) and image_filename - and you never set image_filename by hand. The front end does.

    Wiring it in

    Replace whatever you'd plug a LoadImage into. For a classic img2img chain: CozyGenImageInput → VAEEncode → KSampler with your prompt, then a CozyGenOutput at the end. For the QWEN image-edit example it feeds the edit encoder directly. You keep control of the image from the phone while every other parameter - prompt, steps, seed - lives in the other CozyGen input nodes.

    Install & gotchas

    Install the pack via ComfyUI Manager (search "CozyGen") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/gsusgg/ComfyUI_CozyGen.git
    

    then restart ComfyUI. Only aiohttp is involved here, which ComfyUI already ships.

    The traps are mostly about expectations. If you queue this workflow from inside the plain ComfyUI interface with an empty image_filename, the node just fails to find a file - it's meant to be driven from the web page, not from the graph. Every upload also leaves a UUID-named copy in your input folder, and since there's no auth on the whole pack, anyone on your network can hit :8188/cozygen and upload files or burn your GPU. Fine on a home LAN with --listen; think twice before port-forwarding it. Also, this is a "vibe-coded" project (the README is up-front: built with Gemini, no promises of support), so expect the occasional rough edge rather than polish.

    CategoryCozyGen

    Inputs (2)

    NameTypeDefaultDescription
    param_nameSTRINGImage Input
    image_filenameSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK