Slider with Gradio

Learn how to use sliders in Gradio!

We'll cover the following...

Slider

Slider allows users to select on a continuous numerical scale defined within a minimum and maximum value. A Slider in Gradio can be instantiated with gr.Slider() or with Interface string shortcut 'slider'.

If the slider is passed as an input into a function, it will pass the slider value as a float into the function. If the slider is passed as an output value from a function, it expects the function to return an int or float and will set the slider value to it as long as it is in range.

Slider in Gradio
Slider in Gradio

The main parameters that determine how a Slider functions are the minimum ...