Skip to content

v3.4

Compare
Choose a tag to compare
@aliabd aliabd released this 27 Sep 05:00
· 2170 commits to main since this release
55e6f40

Version 3.4

New Features

1. Gallery Captions πŸ–ΌοΈ

You can now pass captions to images in the Gallery component. To do so you need to pass a {List} of (image, {str} caption) tuples. This is optional and the component also accepts just a list of the images.

Here's an example:

import gradio as gr

images_with_captions = [
    ("https://images.unsplash.com/photo-1551969014-7d2c4cddf0b6", "Cheetah by David Groves"),
    ("https://images.unsplash.com/photo-1546182990-dffeafbe841d", "Lion by Francesco"), 
    ("https://images.unsplash.com/photo-1561731216-c3a4d99437d5", "Tiger by Mike Marrah")
    ]

with gr.Blocks() as demo:
    gr.Gallery(value=images_with_captions)

demo.launch()

gallery_captions

2. Type Values into the Slider πŸ”’

You can now type values directly on the Slider component! Here's what it looks like:

type-slider

3. Better Sketching and Inpainting 🎨

We've made a lot of changes to our Image component so that it can support better sketching and inpainting.

Now supports:

  • A standalone black-and-white sketch
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Sketchpad(), gr.Image())
demo.launch()

bw

  • A standalone color sketch
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Paint(), gr.Image())
demo.launch()

color-sketch

  • An uploadable image with black-and-white or color sketching
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Image(source='upload', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch'
demo.launch()

sketch-new

  • Webcam with black-and-white or color sketching
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Image(source='webcam', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch'
demo.launch()

webcam-sketch

As well as other fixes

Bug Fixes

  1. Fix bug where max concurrency count is not respected in queue by @freddyaboulton in #2286
  2. fix : queue could be blocked by @SkyTNT in #2288
  3. Supports gr.update() in example caching by @abidlabs in #2309
  4. Clipboard fix for iframes by @abidlabs in #2321
  5. Fix: Dataframe column headers are reset when you add a new column by @dawoodkhan82 in #2318
  6. Added support for URLs for Video, Audio, and Image by @abidlabs in #2256
  7. Add documentation about how to create and use the Gradio FastAPI app by @abidlabs in #2263

Documentation Changes

  1. Adding a Playground Tab to the Website by @aliabd in #1860
  2. Gradio for Tabular Data Science Workflows Guide by @merveenoyan in #2199
  3. Promotes postprocess and preprocess to documented parameters by @abidlabs in #2293
  4. Update 2)key_features.md by @voidxd in #2326
  5. Add docs to blocks context postprocessing function by @Ian-GL in #2332

Testing and Infrastructure Changes

  1. Website fixes and refactoring by @aliabd in #2280
  2. Don't deploy to spaces on release by @freddyaboulton in #2313

What's Changed

New Contributors

Full Changelog: v3.3.1...v3.4