Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Non-integer width causes crash #12558

Closed
1 task done
richardstefun opened this issue Aug 14, 2023 · 1 comment · Fixed by #12586
Closed
1 task done

[Bug]: Non-integer width causes crash #12558

richardstefun opened this issue Aug 14, 2023 · 1 comment · Fixed by #12586
Labels
bug Report of a confirmed bug

Comments

@richardstefun
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Request not completed after a non-integer value was pasted to image width

Steps to reproduce the problem

  1. Go to txt2img
  2. Set width/height to some non-integer number
  3. See terminal for stack trace

What should have happened?

I think the number should be rounded (or ceil()-ed)

Version or Commit where the problem happens

v1.5.0

What Python version are you running on ?

Python 3.11.x (above, no supported yet)

What platforms do you use to access the UI ?

Windows, MacOS

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above), Other GPUs

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

No response

Command Line Arguments

--medvram --share

List of extensions

No

Console logs

*** Error completing request
*** Arguments: ('task(z8orpx4adsrkiyd)', 'cover, village, snow, village snow, art, night, night sky, paper, Giclée art, parallax, multi layers, made. by paper, paper artwork', 'lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts,signature, watermark, username, blurry, artist name', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 64, 209.97, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], <gradio.routes.Request object at 0x0000024823104BD0>, 0, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0) {}
    Traceback (most recent call last):
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\txt2img.py", line 62, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\processing.py", line 673, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\processing.py", line 793, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\processing.py", line 1042, in sample
        x = create_random_tensors([opt_C, self.height // opt_f, self.width // opt_f], seeds=seeds, subseeds=subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\processing.py", line 498, in create_random_tensors
        subnoise = devices.randn(subseed, noise_shape)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\richa\Dev\stable-diffusion-webui\modules\devices.py", line 99, in randn
        return torch.randn(shape, device=device)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: randn(): argument 'size' must be tuple of ints, but found element of type float at pos 3

---

Additional information

No response

@richardstefun richardstefun added the bug-report Report of a bug, yet to be confirmed label Aug 14, 2023
@catboxanon catboxanon added bug Report of a confirmed bug and removed bug-report Report of a bug, yet to be confirmed labels Aug 15, 2023
@catboxanon catboxanon linked a pull request Aug 15, 2023 that will close this issue
4 tasks
@catboxanon
Copy link
Collaborator

Fixed by #12586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of a confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants