Skip to content

Add comment in example script denoting how to use api keys without needing frontend#8082

Merged
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
christian-byrne:add-headless-api-nodes-example
May 13, 2025
Merged

Add comment in example script denoting how to use api keys without needing frontend#8082
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
christian-byrne:add-headless-api-nodes-example

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented May 13, 2025

Since #8041, you can use API keys via the webserver API directly, without needing any particular frontend (or a frontend at all).

This means you can create workflows that combine (a) local OS models, (b) tools from the custom node community, and (c) popular paid models and => run everything together via the local Comfy webserver API, letting it handle all the orchestration.

This can benefit users who use Comfy as a backend service, run Comfy via the command line, have their own frontend, and so on.

Here is an example I did: running a workflow that contains the BFL Flux 1.1[pro] Ultra T2I (chosen randomly) in the terminal (via comfy-cli)

ComfyUI_02382_

You can see that the workflow embedded in the output is API format but doesn't persist the API key.

ExifTool Version Number         : 12.76
File Name                       : ComfyUI_02382_.png
Directory                       : /home/c_byrne/projects/comfy-testing-environment/ComfyUI-private/output
File Size                       : 6.6 MB
File Modification Date/Time     : 2025:05:12 17:11:54-07:00
File Access Date/Time           : 2025:05:12 17:13:50-07:00
File Inode Change Date/Time     : 2025:05:12 17:11:54-07:00
File Permissions                : -rw-rw-r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 2048
Image Height                    : 2048
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Prompt                          : {"11": {"inputs": {"prompt": "A dreamy, surreal half-body portrait of a young woman meditating. She has a short, straight bob haircut dyed in pastel pink, with soft bangs covering her forehead. Her eyes are gently closed, and her hands are raised in a calm, open-palmed meditative pose, fingers slightly curved, as if levitating or in deep concentration. She wears a colorful dress made of patchwork-like pastel tiles, featuring clouds, stars, and rainbows. Around her float translucent, iridescent soap bubbles reflecting the rainbow hues. The background is a fantastical sky filled with cotton-candy clouds and vivid rainbow waves, giving the entire scene a magical, dreamlike atmosphere. Emphasis on youthful serenity, whimsical ambiance, and vibrant soft lighting.", "prompt_upsampling": false, "seed": 589991183902375, "aspect_ratio": "1:1", "raw": false, "image_prompt_strength": 0.4000000000000001, "image_prompt": ["14", 0]}, "class_type": "FluxProUltraImageNode", "_meta": {"title": "Flux 1.1 [pro] Ultra Image"}}, "12": {"inputs": {"filename_prefix": "ComfyUI", "images": ["11", 0]}, "class_type": "SaveImage", "_meta": {"title": "Save Image"}}, "14": {"inputs": {"image": "example.png"}, "class_type": "LoadImage", "_meta": {"title": "Load Image"}, "is_changed": ["a8e215ad32a0052fc4190e9c5863428d5ee35cd98b246243842ba8360511b7c4"]}}
Image Size                      : 2048x2048
Megapixels                      : 4.2

@comfyanonymous comfyanonymous merged commit 2156ce9 into Comfy-Org:master May 13, 2025
5 checks passed
@christian-byrne christian-byrne deleted the add-headless-api-nodes-example branch May 13, 2025 03:19
christian-byrne added a commit to christian-byrne/ComfyUI that referenced this pull request May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants