lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: WebUI with Batch Count > 4 #278

Closed hisham-hchowdhu closed 7 months ago

hisham-hchowdhu commented 1 year ago

Is there an existing issue for this?

What happened?

looks like the Automatic WebUI DirectML path runs into issues when using Batch Count > 4. up to batch count 4 works fine , but Erros during inference when its > 4. image

image

8 seems to be max here which corresponds to batch count 4 Anyone seen this issue? @lshqqytiger, could you check this to see the implementation handles it?

Steps to reproduce the problem

image

What should have happened?

no error running webUI producing batch count number of images

Sysinfo

sysinfo-2023-09-11-07-20.txt

What browsers do you use to access the UI ?

Microsoft Edge

Console logs

Model stable-diffusion-v1-5 [Optimized] loaded.
Loading pipeline components...: 100%|████████████████████████████████████████████████████| 8/8 [00:09<00:00,  1.14s/it]
  0%|                                                                                           | 0/21 [00:00<?, ?it/s]
*** Error completing request
*** Arguments: ('task(sjufpvwreext00a)', 'test image', '', [], 20, 'pndm', 4, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x0000021B70E648B0>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\txt2img.py", line 64, in txt2img
        processed = processing.process_images(p)
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\processing.py", line 733, in process_images
        res = process_images_inner(p)
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\processing.py", line 794, in process_images_inner
        return p()
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\sd_onnx.py", line 310, in __call__
        return self.forward()
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\sd_onnx.py", line 420, in forward
        result = self.pipeline(self,
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\modules\sd_onnx_hijack.py", line 114, in OnnxStableDiffusionPipeline__call__
        noise_pred = self.unet(sample=latent_model_input, timestep=timestep, encoder_hidden_states=prompt_embeds)
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\pipelines\onnx_utils.py", line 60, in __call__
        return self.model.run(None, inputs)
      File "C:\Users\ml-admin\Documents\Hisham\auto1111_olive\stable-diffusion-webui-directml\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 217, in run
        return self._sess.run(output_names, input_feed, run_options)
    onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: encoder_hidden_states for the following indices
     index: 0 Got: 8 Expected: 2
     Please fix either the inputs or the model.

---

Additional information

No response