Open PladsElsker opened 11 months ago
Approve TXT2IMG - work, IMG2IMG - Not
Traceback (most recent call last):
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
result = context.run(func, *args)
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "D:\AISD\stable-diffusion-webui\extensions\sd-webui-lcm\scripts\main.py", line 172, in generate_i2i
result = pipe(
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\AISD\stable-diffusion-webui\extensions\sd-webui-lcm\lcm\lcm_i2i_pipeline.py", line 305, in __call__
self.scheduler.set_timesteps(strength, num_inference_steps, original_inference_steps)
File "d:\AISD\stable-diffusion-webui\venv\lib\site-packages\diffusers\schedulers\scheduling_lcm.py", line 377, in set_timesteps
timesteps = lcm_origin_timesteps[::-skipping_step][:num_inference_steps]
TypeError: slice indices must be integers or None or have an __index__ method
Oh I forgot that I actually had your error first. Your error is the right one.
I fixed the stack trace that you had by manually re-ordering the parameters of a function call in the library files (don't do this). Then, mine came next.
When I tried to re-install diffusers, it did not bring your error back, so I forgot about it haha. I think it should have brought the error back, but it didn't for some reason.
Not sure if all that was super clear, so let me re-iterate: @codercv's error is the one I should have issued.
I'm having this problem too, but I was able to use it fine until a week ago.
Same issue here
TypeError: slice indices must be integers or None or have an __index__ method
Same issue here
TypeError: slice indices must be integers or None or have an __index__ method
Same here, i don't know if it can be a new dependency version or something like that?
Same issue here
TypeError: slice indices must be integers or None or have an __index__ method
same here
Having the same issue here for img2img, while txt2img works fine. Seems to be related to gradio and anyio.
S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py:749: FutureWarning: `torch_dtype` is deprecated and will be removed in version 0.25.0.
deprecate("torch_dtype", "0.25.0", "")
S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py:752: FutureWarning: `torch_device` is deprecated and will be removed in version 0.25.0.
deprecate("torch_device", "0.25.0", "")
Traceback (most recent call last):
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
result = context.run(func, *args)
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\extensions\sd-webui-lcm\scripts\main.py", line 172, in generate_i2i
result = pipe(
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\extensions\sd-webui-lcm\lcm\lcm_i2i_pipeline.py", line 305, in __call__
self.scheduler.set_timesteps(strength, num_inference_steps, original_inference_steps)
File "S:\StableDiffusion-Automatic1111\stable-diffusion-webui\venv\lib\site-packages\diffusers\schedulers\scheduling_lcm.py", line 382, in set_timesteps
timesteps = lcm_origin_timesteps[::-skipping_step][:num_inference_steps]
TypeError: slice indices must be integers or None or have an __index__ method
Can also confirm this issue. Updated the diffusers conform the LCM README. (which fixed the error in LCM txt2img)
This is my version of AUTOMATIC1111 version: [v1.6.0-2-g4afaaf8a] • python: 3.10.6 • torch: 2.0.1+cu118 • xformers: N/A • gradio: 3.41.2
The line in 'scheduling_lcm.py' that seems to cause trouble is this one (382): timesteps = lcm_origin_timesteps[::-skipping_step][:num_inference_steps]
Since the error is TypeError: slice indices must be integers or None or have an index method
So 'timesteps' must be filled with an integer?
A few lines back (379) an 'int' is mentioned and it is used for 'lcm_origin_timesteps'. lcm_origin_timesteps = np.asarray(list(range(1, int(original_steps strength) + 1))) c - 1
So, is there a problem with either line 379 or line 382?
(no clue if this was useful mentioning, if not: plz forgive me -I'm totally blonde-)
the same error, img2img and video2video all has this problems
I re-installed diffusers twice, I keep running into this error (LCM txt2img works fine though, only img2img is broken):
This is where the code breaks:
Any idea why this happens? Thanks.