Nodes/APZmedia Together Image Generator for ComfyUI/Together Image Generator with LoRA
ComfyUI Node

Together Image Generator with LoRA

Cloud generation with LoRAs — point Together's API at hosted files, skip the download

By APZmedia·Created 2 years ago·Updated 5 months ago· 0
Together Image Generator with LoRA
    • IMAGE
    promptAn astronaut riding a horse on Mars
    modelblack-forest-labs/FLUX.1-dev-lora
    width1024
    height768
    steps28
    lora_urls
    lora_scales

    Same pack as the plain Together Image Generator, one extra feature: this variant lets you attach LoRAs to a cloud generation. Instead of loading a LoRA into your local ComfyUI environment, you hand Together the URLs of hosted LoRA files and the API applies them server-side. It's the closest thing to "use a LoRA you never have to download" - provided the LoRA is already sitting at a fetchable URL.

    This is niche even by this pack's standards. It only makes sense if you're already paying for Together and you have a LoRA hosted somewhere public. It's also quietly the more fragile of the two nodes, so read the gotchas before you build a workflow around it.

    How it works

    Where the base node does a plain HTTP POST, this one drives the Together Python SDK's images.generate with an image_loras argument: a list of {"path": url, "scale": strength} pairs. That's why there are two text inputs instead of one - lora_urls and lora_scales are comma-separated strings, and they must have the same number of entries or the node raises a ValueError before any API call happens. Order matters: first URL pairs with first scale. The response comes back as base64, which the node decodes into a normal (1, h, w, 3) IMAGE tensor.

    Notice the defaults differ from the sibling node for a real reason. This one ships black-forest-labs/FLUX.1-dev-lora with 28 steps and allows up to 100. That's Dev, not Schnell - and Dev is the Flux variant you can actually fine-tune; Schnell is so aggressively distilled it's effectively useless as a LoRA base. LoRA inference wants Dev and Dev's longer step range. The width/height caps are also looser here, up to 2048.

    The inputs that matter

    • prompt - multiline, same as the base node.
    • model - free text; type the model ID, there's no dropdown.
    • lora_urls - comma-separated hosted LoRA file URLs.
    • lora_scales - comma-separated floats; must match lora_urls in count.
    • steps - 1 to 100, default 28.
    • width / height - 256 to 2048 in steps of 64.

    Output: a single IMAGE, ready for any preview or save node.

    Gotchas

    The API key dance is identical to the base node: TOGETHER_API_KEY in a .env in the pack folder (or an environment variable), then restart ComfyUI. The README doesn't tell you any of this - the code just demands it.

    Then there's this node's own quirk, and it's a doozy. In the shipped code the LoRA node reads the key through an injected class attribute in a way that can throw NameError: name 'TOGETHER_API_KEY' is not defined the moment you add it to the graph. If you hit that, it's the node, not your setup - your key is fine, and the plain generator will keep working. Consider it the price of being an early adopter.

    Also: the LoRA URLs must be publicly fetchable - a local path on your disk won't work, since the request is made from Together's servers. And like the sibling node, there's no seed and no guidance control; outputs aren't reproducible.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/APZmedia/APZmedia-comfy-together-lora
    pip install -r requirements.txt
    

    then restart. ComfyUI Manager also finds it under "APZmedia Together Image Generator". Same light dependencies, no model files.

    Verdict

    If you have a GPU, apply your LoRAs locally - full control, no per-call cost, no URL hosting requirement. Reach for this node in the narrow case where you're already on Together's API and want to test a hosted LoRA without downloading anything. It's a clever idea wrapped in a wobbly early build; expect to babysit it.

    CategoryTogether API

    Inputs (7)

    NameTypeDefaultDescription
    promptSTRINGAn astronaut riding a horse on Mars
    modelSTRINGblack-forest-labs/FLUX.1-dev-lora
    widthINT1024256–2048
    heightINT768256–2048
    stepsINT281–100
    lora_urlsSTRING
    lora_scalesSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE