Skip to content

Gradio 5 ImageMask problem with layers #10573

Closed
@ukaprch

Description

@ukaprch

Describe the bug

Recently I updated from an older release of Gradio V4.4 to the new V5.15 and after some growing pains I have one problem:
If I have a brush and I want to brush an outline on the canvas with an image, I need to set layers=True and use layer1 for the mask. In the past I didn't need to set layers and I used layer 0 as the mask and image: background. So what changed?

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr v 5.15

img_input_2 = gr.ImageMask(label="Input with boxes", interactive=True, type='pil', crop_size=(500, 500),
                            canvas_size=(500, 500), layers=True, brush=gr.Brush(colors=["#0000FF"]))

This is the problematic imagemask where I had to set layers=True in order to draw a mask on the image. I had to set layers1 to do the mask. In the past, this wasn't necessary. Is this considered a "New" feature of 5 release?

Screenshot

No response

Logs

System Info

python v12.5
gradio v5.15
windows 10

Severity

I can work around it

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions