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

ImageEditor Generates The Unexpected Size Image #10265

Open
1 task done
CyberVy opened this issue Dec 30, 2024 · 2 comments
Open
1 task done

ImageEditor Generates The Unexpected Size Image #10265

CyberVy opened this issue Dec 30, 2024 · 2 comments
Labels
bug Something isn't working 🖼️ ImageEditor

Comments

@CyberVy
Copy link

CyberVy commented Dec 30, 2024

Describe the bug

When inputing an image and then doing nothing next but outputing, the size of output image will change.
In my case I input an 1024 * 1024 image, but what I get is a 675 * 675 image.
AFAIK most of sizes will trigger this issue. However when the input image is 512 * 512, it works fine. I don't know how inner mechanism works.
My reproduction below can be tested, or just test in Doc. The same results will be got.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr


def predict(im):
    return im["composite"]

with gr.Blocks() as demo:
    with gr.Row():
        im = gr.ImageEditor(
            type="pil",
        )
        im_preview = gr.Image()

    im.change(predict, outputs=im_preview, inputs=im, show_progress="hidden")

if __name__ == "__main__":
    demo.launch()

System Info

aiofiles: 23.2.1
anyio: 4.7.0
audioop-lts: 0.2.1
fastapi: 0.115.6
ffmpy: 0.4.0
gradio-client==1.5.2 is not installed.
httpx: 0.28.1
huggingface-hub: 0.27.0
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.2.0
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.10.3
pydub: 0.25.1
python-multipart: 0.0.20
pyyaml: 6.0.2
ruff: 0.8.3
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.3
tomlkit: 0.13.2
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.34.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

fsspec: 2024.10.0
httpx: 0.28.1
huggingface-hub: 0.27.0
packaging: 24.2
typing-extensions: 4.12.2
websockets: 14.1

Severity

I can work around it

@CyberVy CyberVy added the bug Something isn't working label Dec 30, 2024
@CyberVy CyberVy changed the title ImageEditor Generats The Unexpected Size Image ImageEditor Generates The Unexpected Size Image Dec 30, 2024
@CyberVy
Copy link
Author

CyberVy commented Dec 30, 2024

@abidlabs I'll be very apprecitated if you can help me. :)

@abidlabs
Copy link
Member

Thanks @CyberVy we'll take a look at this as soon as we can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🖼️ ImageEditor
Projects
None yet
Development

No branches or pull requests

2 participants