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

[Feature Request]: Increase image input size limit in imgtoimg #15723

Open
1 task done
utopic-dev opened this issue May 6, 2024 · 6 comments
Open
1 task done

[Feature Request]: Increase image input size limit in imgtoimg #15723

utopic-dev opened this issue May 6, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@utopic-dev
Copy link

Is there an existing issue for this?

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

What would your feature do ?

There is a size limit for sending a file to imgtoimg I believe it is a maximum of 300mb, I also believe it comes from the Gradio interface, because even changing possible limits in grid files etc we still have this limit imposed, could anyone tell us where this limit to making a change is implicit, it would be incredible as it is limiting a number of cool things to happen, thank you very much in advance for your attention and congratulations on the incredible work 🙏

Proposed workflow

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

Additional information

No response

@utopic-dev utopic-dev added the enhancement New feature or request label May 6, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented May 7, 2024

sorry what and why 300 MB image?

it would be incredible as it is limiting a number of cool things to happen

such as?

@utopic-dev
Copy link
Author

in an ultimate Upscaling process, using multidiffusion/tiled, we insert an input image, in image to image, we increase it in size, there is a limit to inserting an image of maximum 300mb, which makes it impossible to continue creating increasingly larger images, I believe That this input limit is from the Gradio interface, because any other limit I found, such as the grid limit to create a canvas, I have already been able to adjust, can you understand what I'm talking about?

@missionfloyd
Copy link
Collaborator

missionfloyd commented May 8, 2024

I'm not sure gradio has a limit by default. The option to limit the size of uploaded files was only recently added. Perhaps you're reaching the limit for data URLs.

Browsers are not required to support any particular maximum length of data. For example, the Opera 11 browser limited URLs to 65535 characters long which limits data URLs to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a MIME type). Firefox version 97 and newer supports data URLs of up to 32MB (before 97 the limit was close to 256MB). Chromium objects to URLs over 512MB, and Webkit (Safari) to URLs over 2048MB.

Have you tried loopback?
image

@utopic-dev
Copy link
Author

Understood, thank you very much for the clarification, I'm going to test the loopback, I believe you're right and I'm reaching the data URL limit, because even if I send the resulting image via being to img2img it hangs and can't send it and we also don't have any message in the terminal or warnings, I'll test the loopback and tell you here what I achieved, if I couldn't continue inserting increasingly larger files to continue with the upscaling I think the only alternative would be to create the same flow using the Automatic1111 SDK, do you have any suggestion? Thx

@gorillabull
Copy link

300mb image uploads will probably be a new feature in 3 months given how fast things are moving 😂

@missionfloyd
Copy link
Collaborator

we also don't have any message in the terminal or warnings

You might also check for JavaScript errors in the browser's Console (F12).
image

create the same flow using the Automatic1111 SDK

If you want to try that, here's an img2img API example.

import requests
import base64

# Open input image
with open("input.png", "rb") as f:
    img = base64.b64encode(f.read()).decode("utf-8")

# Define parameters
payload = {
    "prompt": "hot air balloon",
    "init_images": [img],
}

# Send request
response = requests.post(url="http://127.0.0.1:7860/sdapi/v1/img2img", json=payload)
r = response.json()

# Save output
with open("output.png", "wb") as f:
    f.write(base64.b64decode(r["images"][0]))

See the API docs for parameters.
image

Payloads can also be generated with this extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants