ai-dock / comfyui

ComfyUI docker images for use in GPU cloud and local environments. Includes AI-Dock base for authentication and improved user experience.
Other
660 stars 225 forks source link

How to generate an image programatically? #37

Closed janoist1 closed 10 months ago

janoist1 commented 10 months ago

Given the system is running, and I'm able to generate images with ComfyUI. I'd like to generate an image programatically:

I'd like to avoid mixing up things inside the container. What is to be installed or required to at least generate an image with python using the current setup ? many thanks !

janoist1 commented 10 months ago

Closing: I've found it out. :)

ultimatech-cn commented 9 months ago

Closing: I've found it out. :)

Hi, I am also find the api method, would you kindly show some sample code?

janoist1 commented 9 months ago

You need to export your workflow in API format. Next, you can use it and make requests, here's an example: https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/basic_api_example.py

ultimatech-cn commented 9 months ago

Thanks, I have test this example. It run well locally. But when I deploy comfyUI as pod in runpod, it can not be used directly. I should use RP API instead. So far I am failed in invoke the api, still trying to make it work.