Deploy the Fooocus App using Modal with persistent volume.
Follow this guide, and you can deploy the Fooocus web app on modal in just a few minutes.
- Start by registering on Modal. 💰 (Bonus - You'll get $30 free every month.)
- Once registered, click on your profile & then settings (top right corner).
- Now click on "API Tokens".
- Click on "New Token".
- You'll get this window. Now copy the command mentioned here.
- Open Terminal.
- Install modal:
pip install modal
- Check if modal is installed using this command:
It should look something like this:
modal --version
- Now paste the command copied at step 5 & run it.
- Then run:
You should be able to see Token ID & Token Secret already set up here.
modal config show
- Now go to any folder you want to run the setup from & git clone this repo & go into the cloned folder.
git clone https://github.com/BarrenWardo/Fooocus-Modal.git && cd Fooocus-Modal
-
You can deploy it now by running:
modal deploy deploy.py
-
You'll get a URL which should be something like this. Open it. Enjoy!
xxyyzz-fooocus.modal.run
It'll take a few minutes for the web app to start. You can check logs on the modal dashboard.
Now Enjoy!
- You can stop the app by going to your Modal Dashboard > Deployed Apps > Fooocus > Stop (Top right)
-
You can also temporarily deploy using
modal serve
. Documentation here. You need to keep the terminal running. If the terminal is stopped, then the app gets stopped.- Go into Fooocus-Modal folder using terminal & run any command below:
modal serve deploy.py
(runs until the terminal is closed)modal serve deploy.py --timeout 3600
(runs for 3600 seconds = 1 hour; you can change this number. Also, the terminal needs to be open or the app gets stopped)
- Go into Fooocus-Modal folder using terminal & run any command below:
-
The deployment is currently set to run on a Tesla T4 GPU and 1 container which will cost approximately $1 per hour. You can change it in the deploy.py file at line 7. The GPU list is available here.
- “t4”
- “l4”
- “a100”
- “h100”
- “a10g”
- “any”
-
Modal Pricing :
I know this might not be the best or most optimal way to deploy the app, but I tried my level best. If you liked this, consider giving a star on this repo & supporting me here: