Nodes/comfyui-byokey/BYOKey Stability AI Image
ComfyUI Node

BYOKey Stability AI Image

Stability's API with your own key — including the one model you can't run

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Stability AI Image
  • image
  • IMAGE
api_key
base_urlhttps://api.stability.ai/v2beta
modelstable-image-ultra
prompt
aspect_ratio1:1
seed0
style_presetNone
cfg_scale4.0
negative_prompt
image_denoise0.50

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), or sd3.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:1 default through 16: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 - optional IMAGE input 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.0 returns something near-identical to your input, 1.0 behaves 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.

Categoryapi/byokey/image

Inputs (11)

NameTypeDefaultDescription
api_keySTRINGStability AI API key (sent as 'Authorization: Bearer ...').
base_urlSTRINGhttps://api.stability.ai/v2betaStability v2beta API base URL. Override only for relays/proxies.
modelCOMBOstable-image-ultra'stable-image-ultra' uses Stable Image Ultra; 'sd3.5-*' uses Stable Diffusion 3.5.
promptSTRINGWhat 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_ratioCOMBO1:1Aspect ratio of generated image. Ignored in image-to-image mode.
seedINT00–4294967294The random seed used for creating the noise.
style_presetoptCOMBONoneOptional desired style of generated image. 'None' applies no preset.
cfg_scaleoptFLOAT4.01–10Stable Diffusion 3.5 only: how strictly the diffusion process adheres to the prompt.
imageoptIMAGEOptional input image for image-to-image generation.
negative_promptoptSTRINGA blurb of text describing what you do not wish to see in the output image.
image_denoiseoptFLOAT0.500–1Denoise 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)

NameTypeDescription
IMAGEIMAGE