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

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

Closed
1 task done
sayyoume opened this issue May 10, 2023 · 16 comments · Fixed by #12588
Closed
1 task done

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

sayyoume opened this issue May 10, 2023 · 16 comments · Fixed by #12588
Labels
bug Report of a confirmed bug

Comments

@sayyoume
Copy link

Is there an existing issue for this?

  • 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: 5ab7f21

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 sayyoume added the bug-report Report of a bug, yet to be confirmed label May 10, 2023
@Rkkss
Copy link

Rkkss commented May 11, 2023

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.

@foobarhe
Copy link

met the problem here, any solution?

@CreateLab
Copy link

CreateLab commented Jun 25, 2023

Gen picture and mask, have similar exception

Picture and mask both are 512*512

mask
image

@isdemx
Copy link

isdemx commented Jun 28, 2023

I have the same exception.

@andupotorac
Copy link

Draw on the image mate. :)

@CreateLab
Copy link

Draw on the image mate. :)

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

@andupotorac
Copy link

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

@CreateLab
Copy link

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

@andupotorac
Copy link

@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.

@ployt0
Copy link

ployt0 commented Aug 5, 2023

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

@catboxanon
Copy link
Collaborator

catboxanon commented Aug 15, 2023

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 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 #12588

@ekleziast
Copy link

ekleziast commented Sep 4, 2023

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?

@catboxanon
Copy link
Collaborator

catboxanon commented Sep 4, 2023

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.

@ekleziast
Copy link

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 <16777216c@gmail.com>
Date:   Thu Jul 27 09:02:22 2023 +0300

    Merge branch 'release_candidate' ```

@catboxanon
Copy link
Collaborator

catboxanon commented Sep 4, 2023

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.

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.

9 participants