Replies: 5 comments 7 replies
-
something like opt = get('/sdapi/v1/options')
opt['sd_model_checkpoint'] = 'model name'
post('/sdapi/v1/options', opt) |
Beta Was this translation helpful? Give feedback.
-
For other lazy people out there, in Python (using requests) this is:
You can also sanity check which models are available with:
|
Beta Was this translation helpful? Give feedback.
-
How do I switch model without using the API? Here's what I have in my processing, but the
|
Beta Was this translation helpful? Give feedback.
-
from modules.shared import opts
opts.sd_model_checkpoint = 'name' it will trigger the model load and is equivalent as changing via ui or via api - its all the same thing. |
Beta Was this translation helpful? Give feedback.
-
Okay, I got it working now. The
override_settings={"sd_model_checkpoint": model_path} If the model is in the checkpoint directory, it just needs the model-name (model.safetensors). In case anyone is helped by the full code for it, here it is.
You can ignore the |
Beta Was this translation helpful? Give feedback.
-
How to switch the model in the api? For example, sdapi/v1/txt2img
Beta Was this translation helpful? Give feedback.
All reactions