seruva19 / kubin

Web-GUI for Kandinsky text-to-image diffusion models.
175 stars 18 forks source link

Switching to KD2.1 errors out on txt2img #151

Closed orcinus closed 11 months ago

orcinus commented 11 months ago

Unsure what's going wrong here or what i'm doing wrong, but while 2.2 works ok (mostly - generations are very iffy compared to SD.Next and half the samplers don't seem to fully converge), selecting 2.1 leads to this error:

Traceback (most recent call last):
  File "E:\Documents\dev\kubin\venv\lib\site-packages\gradio\routes.py", line 442, in run_predict
    output = await app.get_blocks().process_api(
  File "E:\Documents\dev\kubin\venv\lib\site-packages\gradio\blocks.py", line 1392, in process_api
    result = await self.call_function(
  File "E:\Documents\dev\kubin\venv\lib\site-packages\gradio\blocks.py", line 1097, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "E:\Documents\dev\kubin\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "E:\Documents\dev\kubin\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "E:\Documents\dev\kubin\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "E:\Documents\dev\kubin\venv\lib\site-packages\gradio\utils.py", line 703, in wrapper
    response = f(*args, **kwargs)
  File "E:\Documents\dev\kubin\src\ui_blocks\t2i.py", line 291, in generate
    return generate_fn(params)
  File "E:\Documents\dev\kubin\src\web_gui.py", line 45, in <lambda>
    generate_fn=lambda params: kubin.model.t2i(params),
  File "E:\Documents\dev\kubin\src\models\model_diffusers21\model_diffusers.py", line 220, in t2i
    use_sampler(unet_pipe, params["sampler"])
TypeError: use_sampler() missing 1 required positional argument: 'task'

Any idea what i might be doing wrong / missing here?

seruva19 commented 11 months ago

Thanks for reporting this, I will check it. I think this is my oversight, I do not really conduct enough tests before updates, so might miss some regressive errors. Btw, does SD.Next allow you to choose samplers for the K2.2 model? I struggle to find an appropriate scheduler params for custom samplers, so if it does, I might take a sneak peak on its code.