mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
567 stars 152 forks source link

Deploying Fooocus-API on Replicate with Custom Checkpoint #174

Closed NicolasRoehm closed 8 months ago

NicolasRoehm commented 8 months ago

Hello @KonieShadow,

Firstly, thank you for the fantastic work done!

I'm seeking clarification on how you deployed a version of Fooocus-API with a custom preset, like you did for fooocus-api-anime or fooocus-api-realistic, on the Replicate site.

I've managed to load the project locally, create my own "preset", and use it through the command:

~/Fooocus-API/repositories/Fooocus$ python3 entry_with_update.py --preset myOwnPreset

However, when I attempt:

~/Fooocus-API$ cog predict -i prompt='1 girl',preset='myOwnPreset'

The Docker image starts with: Loaded preset: /src/presets/anime.json

How can I deploy Fooocus-API on Replicate but with my own checkpoint? :) Thanks in advance for your help!

Best regards, Nicolas

xiyouZ commented 8 months ago

Greeting, if you want to change the model of API, you could try edit value " default_base_model_name = 'juggernautXL_version6Rundiffusion.safetensors' "in file Fooocus-API\fooocusapi\parameters.py which would load juggernautXL_version6Rundiffusion.safetensors at folder Fooocus-API\repositories\Fooocus\models\checkpoints. when it needs to load.

NicolasRoehm commented 8 months ago

Thank you very much for your help @xiyouZ! I was able to deploy my own model to Replicate <3