BYOKey Stability AI Image
Stability's API with your own key — including the one model you can't run
- image
- IMAGE
Stability is the one vendor in this pack where you can genuinely just run the models locally - SD3.5 has open weights and you've probably got a checkpoint already. So the API route only makes sense for two cases: you want Stable Image Ultra, the closed flagship with no weights at all, or you want SD3.5 without burning your own VRAM. This node covers both, with your own Stability key instead of Comfy's credit storefront.
How it works. Unlike the JSON nodes elsewhere in this pack, Stability's v2beta API wants a multipart form upload. The node builds that (prompt, output format, seed, aspect ratio, and so on), POSTs to api.stability.ai/v2beta (the default base_url), and returns the decoded image as a [1, H, W, C] torch tensor. Two endpoints under the hood: /stable-image/generate/ultra for Ultra, /stable-image/generate/sd3 for the SD3.5 family.
The inputs that matter:
model-stable-image-ultra(the closed one), orsd3.5-large,sd3.5-large-turbo,sd3.5-medium. This choice flips which endpoint and which options apply.prompt- the tooltip spells out the useful bit: to weight a word, use(word:weight)with a value between 0 and 1. That's Stability's native emphasis syntax, and it actually works.aspect_ratio-1:1default through16:9,9:16,3:2,2:3,5:4,4:5,21:9,9:21. Ignored when you feed an image (img2img uses the input's shape).cfg_scale- SD3.5 only; how strictly the diffusion process sticks to your prompt. Ultra ignores it. Default 4, range 1–10.style_preset- 18 named presets (analog-film,cinematic,comic-book,fantasy-art,isometric...) that shape the output without you writing style into the prompt.image- optionalIMAGEinput for image-to-image. Give it a starting image and Stability will rework it rather than start from noise.image_denoise- the img2img strength, 0 to 1.0.0returns something near-identical to your input,1.0behaves as if no image was given. Default 0.5; only used when an image is wired in.negative_prompt- what you don't want to see. Strongly recommend using it with the SD3.5 models.seed- genuinely honored here (it's the noise seed). Lock it in once you like a roll.
Output: one IMAGE socket.
Install. Shared pack, one clone:
cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
# restart ComfyUI; nodes under api/byokey/image
No model downloads, no extra deps - ComfyUI's bundled torch, aiohttp, PIL, numpy and av cover it.
Gotchas. cfg_scale and image_denoise quietly do nothing depending on your model choice - they're scoped to specific modes, so check model before blaming the node. And the usual fresh-pack hygiene: it's new, no community consensus behind it, so skim the source before handing it a key.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Stability AI API key (sent as 'Authorization: Bearer ...'). | |
| base_url | STRING | https://api.stability.ai/v2beta | Stability v2beta API base URL. Override only for relays/proxies. |
| model | COMBO | stable-image-ultra | 'stable-image-ultra' uses Stable Image Ultra; 'sd3.5-*' uses Stable Diffusion 3.5. |
| prompt | STRING | What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results. To control the weight of a given word use the format `(word:weight)`, where `word` is the word you'd like to control the weight of and `weight` is a value between 0 and 1. | |
| aspect_ratio | COMBO | 1:1 | Aspect ratio of generated image. Ignored in image-to-image mode. |
| seed | INT | 00–4294967294 | The random seed used for creating the noise. |
| style_presetopt | COMBO | None | Optional desired style of generated image. 'None' applies no preset. |
| cfg_scaleopt | FLOAT | 4.01–10 | Stable Diffusion 3.5 only: how strictly the diffusion process adheres to the prompt. |
| imageopt | IMAGE | Optional input image for image-to-image generation. | |
| negative_promptopt | STRING | A blurb of text describing what you do not wish to see in the output image. | |
| image_denoiseopt | FLOAT | 0.500–1 | Denoise of input image; 0.0 yields an image identical to input, 1.0 is as if no image was provided. Only used when an image is provided. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |