gradio
gradio copied to clipboard
Can't change SketchPad size
Describe the bug
Sketchpad stops working once you resize it using the .style() method (introduced https://github.com/gradio-app/gradio/issues/1561)
Is there an existing issue for this?
- [X] I have searched the existing issues
Reproduction
import gradio as gr
from PIL import Image
def predict(img):
return Image.new('L', (256, 256))
sp = gr.Sketchpad().style(height=400, width=400)
gr.Interface(fn=predict,
inputs=sp,
outputs='image',
live=True).launch()```
Screenshot
https://user-images.githubusercontent.com/26504141/189708738-7d752762-98e9-413f-9259-a224510bde92.mp4
Logs
Hint: Set streaming=True for Sketchpad component to use live streaming.
Running on local URL: http://127.0.0.1:7861
To create a public link, set `share=True` in `launch()`.
(basically nothing special)
System Info
Gradio: 3.3
OS: Windows 10
Browser: Chrome (latest)
Severity
blocking all usage of gradio
@pngwn can you take a look?
same issue
same issue
It looks like this is fixed now as a result of PR #3277 (thanks @pngwn)
Btw @xenova you can also do something like this:
import gradio as gr
from PIL import Image
def predict(img):
return Image.new('L', (256, 256))
sp = gr.Sketchpad(shape=(400, 400))
gr.Interface(fn=predict,
inputs=sp,
outputs='image',
live=True).launch()
Which produces a nicer looking UI.
Great! Thanks 😃