Fooocus-API
Fooocus-API copied to clipboard
Fooocus and forge-ui
Just a naive question. I have seen that the API files are basically sitting on top of the Foocus installation that is in the repositories folder.
How does this work together?
- Can I install a different fooocus and put it in repositories as another version and make Fooocus API point to version B not version A?
- If so, is there a config file where the path to Fooocus is defined?
- I see that Fooocus and stable-diffusion-webui-forge is from the same lead developer? Is it possible or would it be possible to use Fooocus-API as an endpoint provider for a stable-diffusion-webui-forge installation as well (like putting it in another repository folder, have seperate endpoints for it, but then access it through the same ip address and port)
(Unfortunately there is no disscusion section, so I am posting this here)
In the current and previous versions, the Fooocus repo with a specific hash is checked for and downloaded in main.py. Commit is specified in repositories_versions. It's placed into /repositories/Fooocus
- this is controlled by dir_repos
variable in main.py.
In the next releases (as we can see in the pre-release), the whole Fooocus code will most likely be included with the API.
The stable-diffusion-webui-forge
while sharing the same author, is a completely different project based on AUTO1111. Fooocus-API is what its name says it is - an API for Fooocus. It won't serve you as a universal API system for multiple Stable Diffusion implementations. Also, while it could be theoretically possible to use different versions or even forks of Fooocus as long as they're compatible, I would not recommend it. The API is written for a specific version of Fooocus for a reason. You would have to dig deep into customizing the code for all you're asking for.
Thanks for this very to the point answer. This is super helpful. It really answers all the question. As you said, I was thinking about it along the lines of a universal API system.
Just in case you may know about it: for stable-diffusion-webui-forge is there an API like Fooocus-API included, or can you recommend a project/repository similar to Fooocus-API to have the same functionality?
Sure. Just launch your webui and type /docs at the end of the url.
To fully use the API you should add --api
flag into the /webui/webui-user.bat
on line set COMMANDLINE_ARGS=
before launching.
Other than that you can refer to https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API and other docs about AUTO1111, because as I said it's based on it (actually a remake of controlnet and optimalization things). Most of the things should work the same.