-
-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues and checked the recent builds/commits of both this extension and the webui
Have you read FAQ on README?
- I have updated WebUI and this extension to the latest version
What happened?
When calling /txt2img API, SD Web UI responses code 500 with the following error:
{
"error": "TypeError",
"detail": "",
"body": "",
"errors": "'tuple' object does not support item assignment"
}While generating image via UI works well.
Steps to reproduce the problem
- Enable API mode of SD Web UI
- Send the following requests to
http://localhost:8080/sdapi/v1/txt2imgendpoints:
{
"alwayson_scripts": {
"AnimateDiff": {
"args": [
{
"batch_size": 16,
"closed_loop": "N",
"enable": true,
"format": ["GIF"],
"fps": 8,
"interp": "Off",
"interp_x": 10,
"last_frame": null,
"latent_power": 1,
"latent_scale": 32,
"loop_number": 0,
"model": "mm_sd15_v3.safetensors",
"overlap": -1,
"stride": 1,
"video_length": 32
}
]
}
},
"batch_size": 32,
"cfg_scale": 7,
"height": 512,
"negative_prompt": "(worst quality:1.2), (low quality:1.2), (lowres:1.1), (monochrome:1.1), (greyscale), multiple views, comic, sketch, (((bad anatomy))), (((deformed))), (((disfigured))), watermark, multiple_views, mutation hands, mutation fingers, extra fingers, missing fingers, watermark, nude, nsfw",
"prompt": "masterpiece, 30 year old women, cleavage, red hair, bun, ponytail, medium breast, desert, cactus vibe, sensual pose, (looking in the camera:1.2), (front view:1.2), facing the camera, close up, upper body",
"steps": 20,
"width": 512
}What should have happened?
Response code should be 200, and animated image should be generated.
Commit where the problem happens
webui: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
extension: 12a503b
What browsers do you use to access the UI ?
API using Swagger
Command Line Arguments
ACCELERATE=true exec python ./launch.py -f --api --api-log --no-gradio-queue --skip-prepare-environment --no-hashing --no-download-sd-model --loglevel INFO --log-startup --listen --port 8080 --xformersConsole logs
2024-03-07 11:48:26 INFO [modules.shared_state] Starting job scripts_txt2img
*** Error running before_process: /opt/ml/code/extensions/sd-webui-animatediff/scripts/animatediff.py
Traceback (most recent call last):
File "/opt/ml/code/modules/scripts.py", line 776, in before_process
script.before_process(p, *script_args)
File "/opt/ml/code/extensions/sd-webui-animatediff/scripts/animatediff.py", line 54, in before_process
params = get_animatediff_arg(p)
File "/opt/ml/code/extensions/sd-webui-animatediff/scripts/animatediff_utils.py", line 43, in get_animatediff_arg
p.script_args[script.args_from] = animatediff_arg
TypeError: 'tuple' object does not support item assignment
---
2024-03-07 11:48:26 INFO [modules.shared_state] Ending job scripts_txt2img (0.00 seconds)
*** API error: POST: http://localhost:8001/sdapi/v1/txt2img {'error': 'TypeError', 'detail': '', 'body': '', 'errors': "'tuple' object does not support item assignment"}
Traceback (most recent call last):
File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 98, in receive
return self.receive_nowait()
File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
raise WouldBlock
anyio.WouldBlock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 78, in call_next
message = await recv_stream.receive()
File "/home/user/.local/lib/python3.10/site-packages/anyio/streams/memory.py", line 118, in receive
raise EndOfStream
anyio.EndOfStream
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/ml/code/modules/api/api.py", line 186, in exception_handling
return await call_next(request)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 108, in __call__
response = await self.dispatch_func(request, call_next)
File "/opt/ml/code/modules/api/api.py", line 150, in log_and_time
res: Response = await call_next(req)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 92, in __call__
await self.simple_response(scope, receive, send, request_headers=headers)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 147, in simple_response
await self.app(scope, receive, send)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
await responder(scope, receive, send)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
await self.app(scope, receive, self.send_with_gzip)
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
await route.handle(scope, receive, send)
File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/home/user/.local/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/home/user/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/opt/ml/code/modules/api/api.py", line 477, in text2imgapi
processed = process_images(p)
File "/opt/ml/code/modules/processing.py", line 785, in process_images
res = process_images_inner(p)
File "/opt/ml/code/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 46, in processing_process_images_hijack
ad_params = get_animatediff_arg(p)
File "/opt/ml/code/extensions/sd-webui-animatediff/scripts/animatediff_utils.py", line 43, in get_animatediff_arg
p.script_args[script.args_from] = animatediff_arg
TypeError: 'tuple' object does not support item assignment
---Additional information
Python 3.10.12, torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 triton==2.1.0 xformers==0.0.23.post1
Metadata
Metadata
Assignees
Labels
No labels