lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.68k stars 175 forks source link

[Bug]: inpainting tuple error #294

Closed OperationTwelve closed 4 months ago

OperationTwelve commented 9 months ago

Is there an existing issue for this?

What happened?

When trying to inpaint using an inpaint model I got the following error: TypeError: 'tuple' object does not support item assignment

Steps to reproduce the problem

  1. have "set COMMANDLINE_ARGS=--api --lowvram --no-half --skip-torch-cuda-test --upcast-sampling set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512" in webui-user.bat
  2. set optimization in settings to sub-quad
  3. Switch to inpaint model
  4. switch to img2img inpaint
  5. load image
  6. paint
  7. click generate
  8. if no error try swapping back to another model and then back to the inpaint model... I used deliberate, epiC, and realistic vision inpaint models.

What should have happened?

changed the inpainted area to what was prompted

Sysinfo

sysinfo-2023-10-07-16-27.txt

What browsers do you use to access the UI ?

Other

Console logs

Already up to date.
venv "F:\SD\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.6.0
Commit hash: 6a38e1102494a9a9ed303c0c2c79c9b58fbb973e
Launching Web UI with arguments: --api --lowvram --no-half --skip-torch-cuda-test --upcast-sampling --autolaunch
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [cadc1eef6f] from F:\SD\stable-diffusion-webui-directml\models\Stable-diffusion\deliberate_v3-inpainting.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: F:\SD\stable-diffusion-webui-directml\configs\v1-inpainting-inference.yaml
Startup time: 111.6s (prepare environment: 2.7s, import torch: 61.1s, import gradio: 12.3s, setup paths: 12.4s, initialize shared: 11.6s, other imports: 4.0s, setup codeformer: 0.8s, setup gfpgan: 0.4s, list SD models: 1.2s, load scripts: 1.2s, initialize extra networks: 0.4s, create ui: 1.8s, gradio launch: 3.1s, add APIs: 0.2s).
Applying attention optimization: sub-quadratic... done.
Model loaded in 71.6s (load weights from disk: 5.1s, create model: 1.5s, apply weights to model: 63.3s, apply float(): 0.6s, load textual inversion embeddings: 0.1s, calculate empty prompt: 0.9s).
*** Error completing request
*** Arguments: ('task(i2ovfhynflj0g1r)', 2, 'blond hair', '', [], <PIL.Image.Image image mode=RGBA size=512x512 at 0x1A14AB6DF30>, None, {'image': <PIL.Image.Image image mode=RGBA size=512x512 at 0x1A14AB6E1A0>, 'mask': <PIL.Image.Image image mode=RGB size=512x512 at 0x1A14B51C640>}, None, None, None, None, 100, 'DPM++ 2M Karras', 4, 0, 1, 1, 1, 7, 1.5, 0.47, 0, 512, 512, 1, 0, 1, 32, 0, '', '', '', [], False, [], '', <gradio.routes.Request object at 0x000001A14AB4C7F0>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, 0, 0, '* `CFG Scale` should be 2 or lower.', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "F:\SD\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "F:\SD\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "F:\SD\stable-diffusion-webui-directml\modules\img2img.py", line 217, in img2img
        processed = process_images(p)
      File "F:\SD\stable-diffusion-webui-directml\modules\processing.py", line 733, in process_images
        res = process_images_inner(p)
      File "F:\SD\stable-diffusion-webui-directml\modules\processing.py", line 807, in process_images_inner
        p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
      File "F:\SD\stable-diffusion-webui-directml\modules\processing.py", line 1523, in init
        self.image_conditioning = self.img2img_image_conditioning(image * 2 - 1, self.init_latent, image_mask)
      File "F:\SD\stable-diffusion-webui-directml\modules\processing.py", line 360, in img2img_image_conditioning
        return self.inpainting_image_conditioning(source_image, latent_image, image_mask=image_mask)
      File "F:\SD\stable-diffusion-webui-directml\modules\processing.py", line 331, in inpainting_image_conditioning
        conditioning_image = torch.lerp(
      File "F:\SD\stable-diffusion-webui-directml\modules\dml\hijack\torch.py", line 42, in lerp
        args[i] = args[i].cpu()
    TypeError: 'tuple' object does not support item assignment

---

Additional information

It used to work. -./O.-

lshqqytiger commented 9 months ago

Should be fixed in f93568816aedf7d1140cfefba89b6d0861fcd494