Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using endpoint "/agent-scheduler/v1/queue/txt2img" #259

Open
hw25io opened this issue Aug 20, 2024 · 0 comments
Open

Error when using endpoint "/agent-scheduler/v1/queue/txt2img" #259

hw25io opened this issue Aug 20, 2024 · 0 comments

Comments

@hw25io
Copy link

hw25io commented Aug 20, 2024

First of all, i apologize if this is an issue related to vladmandics automatic and not this extension. In this case just tell me and i'll open the issue there.

Description
I'm trying to use the endpoint mentioned in the title and i don't know if it's really and error or if i'm simply not using the api correctly. Any help is highly appreciated!

Example payload:

{
  "width": 832,
  "steps": "70",
  "height": 1216,
  "batch_size": "2",
  "prompt": "A cat riding a bycicle",
  "sampler_name": "Euler a",
  "cfg_scale": "5"
}

The page here says:

"The two apis /agent-scheduler/v1/queue/txt2img and /agent-scheduler/v1/queue/img2img support all the parameters of the original webui apis."

But when sending the payload mentioned above i get this error:

{
 "detail": [
  {
   "loc": [
    "body",
    "parameters"
   ],
   "msg": "field required",
   "type": "value_error.missing"
  },
  {
   "loc": [
    "body",
    "info"
   ],
   "msg": "field required",
   "type": "value_error.missing"
  }
 ]
}

So checked what vladmandics api doc is saying:

image

Ok, now i'm using this rewritted payload:

{
  "info": "no idea",
  "parameters": {
    "width": 832,
    "steps": "20",
    "height": 1216,
    "batch_size": "1",
    "prompt": "A cat riding a bycicle",
    "sampler_name": "Euler a",
    "cfg_scale": "5"
  }
}

After sending this payload i get this error:

{
  "error": "AttributeError",
  "code": 500,
  "detail": "",
  "body": "",
  "errors": "'ResTxt2Img' object has no attribute 'override_settings'"
}

And here's the log from the console:

08:17:42-522776 ERROR    API error: POST: http://sd.hw25.ch/agent-scheduler/v1/queue/txt2img {'error': 'AttributeError', 'code': 500, 'detail': '', 'body': '',
                         'errors': "'ResTxt2Img' object has no attribute 'override_settings'"}
08:17:42-526777 ERROR    HTTP API: AttributeError
┌─────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────┐
│ D:\SD-Next\venv\lib\site-packages\anyio\streams\memory.py:105 in receive                                                                                         │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\anyio\streams\memory.py:100 in receive_nowait                                                                                  │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
WouldBlock

During handling of the above exception, another exception occurred:

┌─────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────┐
│ D:\SD-Next\venv\lib\site-packages\anyio\streams\memory.py:118 in receive                                                                                         │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: 'MemoryObjectItemReceiver' object has no attribute 'item'

During handling of the above exception, another exception occurred:

┌─────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────┐
│ D:\SD-Next\venv\lib\site-packages\starlette\middleware\base.py:159 in call_next                                                                                  │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\anyio\streams\memory.py:120 in receive                                                                                         │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
EndOfStream

During handling of the above exception, another exception occurred:

┌─────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────┐
│ D:\SD-Next\modules\api\middleware.py:40 in log_and_time                                                                                                          │
│                                                                                                                                                                  │
│   39 │   │   │   ts = time.time()                                                                                                                                │
│ > 40 │   │   │   res: Response = await call_next(req)                                                                                                            │
│   41 │   │   │   duration = str(round(time.time() - ts, 4))                                                                                                      │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\starlette\middleware\base.py:165 in call_next                                                                                  │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\starlette\middleware\base.py:151 in coro                                                                                       │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\starlette\middleware\gzip.py:26 in __call__                                                                                    │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\starlette\middleware\exceptions.py:65 in __call__                                                                              │
│                                                                                                                                                                  │
│                                                                     ... 14 frames hidden ...                                                                     │
│                                                                                                                                                                  │
│ D:\SD-Next\venv\lib\site-packages\anyio\_backends\_asyncio.py:859 in run                                                                                         │
│                                                                                                                                                                  │
│ D:\SD-Next\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\api.py:120 in queue_txt2img                                                               │
│                                                                                                                                                                  │
│   119 │   │   callback_url = args.pop("callback_url", None)                                                                                                      │
│ > 120 │   │   task = task_runner.register_api_task(                                                                                                              │
│   121 │   │   │   task_id,                                                                                                                                       │
│                                                                                                                                                                  │
│ D:\SD-Next\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\task_runner.py:310 in register_api_task                                                   │
│                                                                                                                                                                  │
│   309 │   │                                                                                                                                                      │
│ > 310 │   │   (params, script_params) = self.__serialize_api_task_args(is_img2img, checkpoint=checkpoint, vae=vae, **args)                                       │
│   311                                                                                                                                                            │
│                                                                                                                                                                  │
│ D:\SD-Next\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\task_runner.py:144 in __serialize_api_task_args                                           │
│                                                                                                                                                                  │
│   143 │   ):                                                                                                                                                     │
│ > 144 │   │   named_args = serialize_api_task_args(api_args, is_img2img, checkpoint=checkpoint, vae=vae)                                                         │
│   145 │   │   checkpoint = get_dict_attribute(named_args, "override_settings.sd_model_checkpoint", None)                                                         │
│                                                                                                                                                                  │
│ D:\SD-Next\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\task_helpers.py:480 in serialize_api_task_args                                            │
│                                                                                                                                                                  │
│   479 │                                                                                                                                                          │
│ > 480 │   if args.override_settings is None:                                                                                                                     │
│   481 │   │   args.override_settings = {}                                                                                                                        │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: 'ResTxt2Img' object has no attribute 'override_settings'

Details about vladmandics automatic

08:16:20-462629 INFO     Starting SD.Next
08:16:20-469630 INFO     Logger: file="D:\SD-Next\sdnext.log" level=INFO size=5119640 mode=append
08:16:20-470629 INFO     Python version=3.10.11 platform=Windows bin="D:\SD-Next\venv\Scripts\python.exe"
                         venv="D:\SD-Next\venv"
08:16:20-577629 INFO     Version: app=sd.next updated=2024-07-24 hash=a874b27e branch=master
                         url=https://github.com/vladmandic/automatic.git/tree/master ui=main
08:16:20-829655 INFO     Platform: arch=AMD64 cpu=Intel64 Family 6 Model 183 Stepping 1, GenuineIntel system=Windows
                         release=Windows-10-10.0.19045-SP0 python=3.10.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant