gradio_imageslider

raw JSON →
0.0.20 verified Mon Apr 27 auth: no python

A custom Gradio component for comparing two images via an interactive before/after slider. Current version 0.0.20. Release cadence is irregular.

pip install gradio_imageslider
error AttributeError: module 'gradio_imageslider' has no attribute 'ImageSlider'
cause Incorrect import (e.g., import gradio_imageslider as gis; gis.ImageSlider) or old version.
fix
Use: from gradio_imageslider import ImageSlider
error TypeError: ImageSlider.__init__() got an unexpected keyword argument 'value'
cause Older versions (<0.0.15) used 'images' instead of 'value'.
fix
Use 'value' parameter (or upgrade).
gotcha The component does not support dynamic updates via gr.update() in early releases (<=0.0.18). If you need to update images after the interface loads, consider using a ref or a workaround.
fix Upgrade to >=0.0.20 or use a Gradio 4.x state pattern.
gotcha If you pass a single string instead of a tuple, the component will fail silently. Always pass a tuple of two strings (file paths or URLs).
fix Ensure value is a tuple: ("img_left.png", "img_right.png").

Minimal example showing a static before/after comparison with two images.

import gradio as gr
from gradio_imageslider import ImageSlider

with gr.Blocks() as demo:
    ImageSlider(value=("image1.png", "image2.png"), label="Compare")

demo.launch()