lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: error in pic2pic with inpaint model with TypeError: 'tuple' object does not support item assignment, inpainting fails with any model #295

Open ride5k opened 12 months ago

ride5k commented 12 months ago

Is there an existing issue for this?

What happened?

had same issue with "legacy" auto instance, despite disabling all extensions. reinstalled fork from scratch to eliminate variables into new folder using "git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml && cd stable-diffusion-webui-directml && git submodule init && git submodule update"

version info:

version: 1.6.0  •  python: 3.10.6  •  torch: 2.0.0+cpu  •  xformers: N/A  •  gradio: 3.41.2  •  checkpoint: c6bbc15e32

despite reinstall identical problem persists as described below:

img2img inpaint tab select inpaint model sd-v1-5-inpainting.ckpt [c6bbc15e32] load image mask image select inpaint only masked click generate

console displays:

Error completing request Arguments: ('task(83graykkv6jptg7)', 2, 'basketball', '', [], None, None, {'image': <PIL.Image.Image image mode=RGBA size=1728x2592 at 0x26312A69060>, 'mask': <PIL.Image.Image image mode=RGB size=1728x2592 at 0x26312A692A0>}, None, None, None, None, 20, 'DPM++ 2M Karras', 4, 0, 1, 1, 1, 7, 1.5, 0.75, 0, 512, 512, 1, 0, 1, 32, 0, '', '', '', [], False, [], '', <gradio.routes.Request object at 0x0000026312A680D0>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, ' CFG Scale should be 2 or lower.', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '

Will upscale the image by the selected scale factor; use width and height sliders to set tile size

', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {} Traceback (most recent call last): File "T:\newauto\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f res = list(func(
args, *kwargs)) File "T:\newauto\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f res = func(args, *kwargs) File "T:\newauto\stable-diffusion-webui-directml\modules\img2img.py", line 217, in img2img processed = process_images(p) File "T:\newauto\stable-diffusion-webui-directml\modules\processing.py", line 733, in process_images res = process_images_inner(p) File "T:\newauto\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 "T:\newauto\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 "T:\newauto\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 "T:\newauto\stable-diffusion-webui-directml\modules\processing.py", line 331, in inpainting_image_conditioning conditioning_image = torch.lerp( File "T:\newauto\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


change model to non-inpaint version v1-5-pruned.ckpt [e1441589a6] error message in console does NOT appear generation appears to proceed in preview and completes successfully inpainted generation does NOT "paste" into original img2img image masked composite shows original img2img image

NON INPAINT TEST (img2img only)

img2img module img2img tab load image select inpaint model sd-v1-5-inpainting.ckpt [c6bbc15e32] attempt to generate fails and produces identical console output select non-inpaint model v1-5-pruned.ckpt [e1441589a6] generation appears to proceed in preview and completes successfully img2img generation displays and saves properly

Steps to reproduce the problem

see above section

What should have happened?

inpainting should have saved modified image with non-inpaint model inpainting should have completed without error with inpaint model

Sysinfo

sysinfo-2023-10-07-17-28.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

venv "T:\newauto\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:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [e1441589a6] from T:\newauto\stable-diffusion-webui-directml\models\Stable-diffusion\v1-5-pruned.ckpt
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 7.1s (prepare environment: 0.3s, import torch: 2.7s, import gradio: 0.8s, setup paths: 0.7s, initialize shared: 0.8s, other imports: 0.3s, setup codeformer: 0.2s, load scripts: 0.7s, create ui: 0.3s, gradio launch: 0.3s).
Creating model from config: T:\newauto\stable-diffusion-webui-directml\configs\v1-inference.yaml
Applying attention optimization: V1... done.
Model loaded in 10.2s (load weights from disk: 3.5s, create model: 0.3s, apply weights to model: 5.6s, apply half(): 0.6s, calculate empty prompt: 0.1s).
Reusing loaded model v1-5-pruned.ckpt [e1441589a6] to load sd-v1-5-inpainting.ckpt [c6bbc15e32]
Loading weights [c6bbc15e32] from T:\newauto\stable-diffusion-webui-directml\models\Stable-diffusion\sd-v1-5-inpainting.ckpt
Creating model from config: T:\newauto\stable-diffusion-webui-directml\configs\v1-inpainting-inference.yaml
Applying attention optimization: V1... done.
Model loaded in 2.2s (create model: 0.3s, apply weights to model: 1.5s, move model to device: 0.2s, calculate empty prompt: 0.1s).
*** Error completing request
*** Arguments: ('task(ua0dndn4qgouvg2)', 2, 'basketball', '', [], None, None, {'image': <PIL.Image.Image image mode=RGBA size=2592x1728 at 0x28434598B80>, 'mask': <PIL.Image.Image image mode=RGB size=2592x1728 at 0x2854ECC3D60>}, None, None, None, None, 20, 'DPM++ 2M Karras', 4, 0, 1, 1, 1, 7, 1.5, 1, 0, 512, 512, 1, 0, 1, 32, 0, '', '', '', [], False, [], '', <gradio.routes.Request object at 0x0000028519DD24D0>, 0, False, '', 0.8, -1, False, -1, 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 "T:\newauto\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "T:\newauto\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "T:\newauto\stable-diffusion-webui-directml\modules\img2img.py", line 217, in img2img
        processed = process_images(p)
      File "T:\newauto\stable-diffusion-webui-directml\modules\processing.py", line 733, in process_images
        res = process_images_inner(p)
      File "T:\newauto\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 "T:\newauto\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 "T:\newauto\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 "T:\newauto\stable-diffusion-webui-directml\modules\processing.py", line 331, in inpainting_image_conditioning
        conditioning_image = torch.lerp(
      File "T:\newauto\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

No response