stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

img2img api ValueError: Coordinate 'right' is less than 'left'

Open sayyoume opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

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

What happened?

if i use mask and set inpaint_full_res =true

pyton will tip ValueError: Coordinate 'right' is less than 'left' image

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

i hope it can working

Commit where the problem happens

SHA-1: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--api --listen

List of extensions

no

Console logs

no

Additional information

No response

sayyoume avatar May 10 '23 15:05 sayyoume

This happens when you're inpainting but there's no mask. I noticed this as well, some bug remove the mask randomly, not sure how to reproduce this.

Rkkss avatar May 11 '23 11:05 Rkkss

met the problem here, any solution?

foobarhe avatar Jun 15 '23 09:06 foobarhe

Gen picture and mask, have similar exception

Picture and mask both are 512*512

mask image

CreateLab avatar Jun 25 '23 17:06 CreateLab

I have the same exception.

isdemx avatar Jun 28 '23 17:06 isdemx

Draw on the image mate. :)

andupotorac avatar Jul 14 '23 01:07 andupotorac

Draw on the image mate. :)

But how set, that it is an inpant, not just img2img?

CreateLab avatar Jul 14 '23 05:07 CreateLab

Like this. Note the size should be for your mask, so maybe double if you want it higher resolution - but not for the entire image, when you use inpaint. 3 - LARGE image still paints only inside mask

andupotorac avatar Jul 14 '23 08:07 andupotorac

@andupotorac here we discuss an api, how to create curl request for inpanting draw?

CreateLab avatar Jul 14 '23 13:07 CreateLab

@andupotorac here we discuss an api, how to create curl request for inpanting draw?

Oh, didn't notice that. Can't help with the API.

andupotorac avatar Jul 15 '23 20:07 andupotorac

I had this error, many times.

Today I'm using inpaint upload. Based on the testimony above I replaced transparency in my mask file with white, and the error was gone, but it's attempting to inpaint the white area. Disjointedly.

problem0

problem1

ployt0 avatar Aug 05 '23 05:08 ployt0

The problem here is the webui expects the mask input to be a binary mask (RGB, only white and black), not an alpha mask. That being said some conversion should ideally happen automatically to correct this.

Edit: Actually looks like some upstream breaking change with Gradio broke this. Will have a fix shortly.

catboxanon avatar Aug 15 '23 17:08 catboxanon

Fixed by https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12588

catboxanon avatar Aug 15 '23 18:08 catboxanon

Thank you! First, we wrote a crutch so that in .png the mask would be converted to black and white format without opacity. Now nothing works, although in version commit 68f336bd994bed5442ad95bad6b6ad5564a5409a (HEAD -> master, tag: v1.5.1, origin/master, origin/HEAD) everything worked fine. Now, I understand that the .png needs to be set to opacity instead of a black and white image?

ekleziast avatar Sep 04 '23 07:09 ekleziast

It's supposed to work for both. If it doesn't then something is going wrong. Last I tried both worked for me as of 1.6.0.

catboxanon avatar Sep 04 '23 08:09 catboxanon

It's supposed to work for both. If it doesn't then something is going wrong. Last I tried both worked for me as of 1.6.0.

You can try processing this image with the provided mask (both 1179x1280)

Spoiler

photo_2021-10-12_20-04-55

image (3)

Screenshot_1

Screenshot_2

The same pictures work fine on the version:

commit 68f336bd994bed5442ad95bad6b6ad5564a5409a (HEAD -> master, tag: v1.5.1, origin/master, origin/HEAD)
Merge: a3ddf464 50973ec7
Author: AUTOMATIC1111 <[email protected]>
Date:   Thu Jul 27 09:02:22 2023 +0300

    Merge branch 'release_candidate' ```

ekleziast avatar Sep 04 '23 09:09 ekleziast

Your mask image is RGBA, and furthermore the alpha channel is not "full on" (i.e. a value of 255) across the whole image. The right-hand side is partially transparent. If your convert the image to RGB or fix the alpha channel it will work properly. So, this is not a bug.

The previous behavior was not correct because it was unable to handle alpha masks, but as a side affect it was more tolerable to mistakes like this in images themselves. The behavior is fixed now but it means you must make sure your masks are made properly.

catboxanon avatar Sep 04 '23 09:09 catboxanon