ComfyUI Node

SaveToRedis

Push JSON to Redis so the rest of your stack can read it

By un-seen·Created 2 years ago·Updated 2 years ago· 46
SaveToRedis
  • data
    key

    SaveToRedis does exactly one thing: takes a JSON payload and writes it to a Redis key. No files, no HTTP calls, no polling - one SET and the data is out of ComfyUI and sitting in a key-value store where anything with a Redis client can pick it up. If you've ever wanted ComfyUI to hand a result to another process instead of printing it to the screen, this is the hand-off point.

    It's part of comfyui-tensorops, the pack by GitHub user un-seen that reads like the plumbing of a production pipeline: images to S3, metadata to SurrealDB and Redis, and a websocket stream on the side. You install it because you've inherited that pipeline or you're building something similar - this is not a pack you add to see what it does. It's a single commit from October 2024, MIT-licensed, and its only community moment was ComfyUI Manager flagging it for node-name conflicts with Kijai's Florence2 pack. Quiet since, and that's fine for what it is.

    How it works

    Mechanically it's as simple as a node gets. It opens a connection with redis.Redis.from_url(REDIS_URL) (that URL comes from the pack's config, more below), calls SET key json.dumps(data), and closes the connection. The data input is a JSON-typed value, so anything that emits JSON in the graph - a custom metadata node, a settings blob, a results summary - can be wired straight in.

    The pair you'll actually use is this node plus the pack's FetchFromRedis, which reads the same key back into the graph as a JSON value. That round-trip is the whole point: ComfyUI writes a result, an external worker reads it, does its thing, writes back, and the next workflow run picks it up. It's the simplest way to get state crossing the boundary of a single ComfyUI process.

    The inputs

    • key - the Redis key name. Choose something namespaced, like gen:result:latest, because the node never clears anything you don't overwrite.
    • data - the JSON payload to store.

    No outputs - it's an output node, so it ends its branch.

    Install and config

    The repo has no real README, so it's the standard two ways. In ComfyUI Manager, search the pack title comfyui-tensorop, or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/un-seen/comfyui-tensorops
    

    then restart ComfyUI. Note the pack's requirements.txt is a full stack - boto3, surrealist, fal-client, replicate, scipy - not just redis. Everything installs into your shared ComfyUI Python environment, so this isn't a featherweight addition.

    Connection settings live in nodes/config.py, hardcoded with empty-string defaults:

    REDIS_URL = "redis://localhost:6379/0"
    

    Edit it, restart ComfyUI, and make sure a Redis server is actually running at that address. If REDIS_URL is still empty or the server is down, this node will throw a connection error the moment your workflow runs - there's no retry and no fallback.

    Gotchas worth knowing

    • No TTL. The node doesn't set an expiry, so keys persist until you overwrite or evict them. "Latest result" style keys will silently keep their last value, which can look like a bug when you're debugging why a downstream read "didn't update."
    • It's synchronous and blocking. SET runs to completion before the prompt continues. For small JSON blobs that's nothing; don't build a workflow that stores megabytes through this and expect snappy runs.
    • No error handling. Redis down means the node raises and your prompt errors out. That's arguably a feature - you notice immediately instead of silently losing data - but it's worth knowing before you wire it into a long batch.
    • This is a personal-pack node. Before you point it at a Redis instance with real data, skim the source. Custom nodes run arbitrary code with your user's permissions, and this one has no review history to lean on.

    If your goal is passing images rather than data, the same pack has SendImageOnWebSocket for streaming and SaveImageToS3 for durable storage - but for plain JSON hand-offs, this is the node that does the job with the least ceremony.

    Categorydatabase_ops

    Inputs (2)

    NameTypeDefaultDescription
    keySTRING
    dataJSON

    Outputs (0)

    No outputs