lllyasviel / lllyasviel/stable-diffusion-webui-forge

API - /sdapi/v1/options not being set

Open
#2,589 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I am unable to have the parameters of ```sdapi/v1/options``` persist in the webui session. I may just have a fundamental misunderstanding of `/options`.

I can't seem to get the objects to persists. txt2img API calls made after POSTing options result in images not using the values which were set for `/options`

For example, calling

`curl -X POST 192.168.3.47:7864/sdapi/v1/options \
-H "Content-Type: application/json" \
-d '{
"forge_unet_storage_dtype": "Automatic",
"forge_inference_memory": 1024,
"forge_async_loading": "Queue",
"forge_pin_shared_memory": "CPU",
"forge_preset": "flux",
"forge_additional_modules": ["ae.safetensors", "clip_l.safetensors", "t5xxl_fp16.safetensors"],
"sd_model_checkpoint": "flux/flux1-dev-fp8.safetensors",
"forge_unet_storage_dtype": "Automatic",
}'`

returns `INFO: 192.168.3.11:34048 - "GET /sdapi/v1/options HTTP/1.1" 200 OK`. Following calls to `sdapi/v1/txt2img`, and following calls to `txt2img` do not have the modules loaded, resulting in the output
`
Loading Model: {'checkpoint_info': {'filename': '/workspace/project/stable-diffusion-webui-forge/models/Stable-diffusion/flux/flux1-dev-fp8.safetensors', 'hash': '26acbda5'}, 'additional_modules': [], 'unet_storage_dtype': None}
[Unload] Trying to free all memory for cuda:0 with 0 models keep loaded ... Done.
StateDict Keys: {'transformer': 780, 'vae': 0, 'ignore': 0}
INFO: 192.168.3.11:60048 - "POST /sdapi/v1/txt2img HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
...
AssertionError: You do not have CLIP state dict!
`

edit: I am not sure whether this is an options issue or an issue loading the text encoders. I am still investigating. `override_settings` works in place of using `/options`, but this is not ideal.

Hopefully @altoiddealer or someone else can assist.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the POST to /sdapi/v1/options followed by /sdapi/v1/txt2img, using valid JSON and checking the returned options. Trace the handlers for /sdapi/v1/options and /sdapi/v1/txt2img to determine whether settings persist or text encoders fail to load; done means the root cause is isolated and the expected behavior is verified without the CLIP assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.