File size: 761 Bytes
497ac8a
 
51a4505
497ac8a
e3f35ee
8a431c9
497ac8a
 
 
72bad37
51a4505
72bad37
497ac8a
 
 
8a431c9
 
 
 
 
 
 
51a4505
497ac8a
51a4505
 
72bad37
 
497ac8a
 
51a4505
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr

data_with_hf_url = [
    {
        "image": "https://huggingface.co/renderartist/retrocomicflux/resolve/main/images/ComfyUI_temp_ipugi_00131_.png",
        "title": "Test LoRA"
    }
]

def test_function(gallery):
    print("This function will never be called due to SSRF validation error")
    return gr.update()

with gr.Blocks() as demo:
    
    gallery = gr.Gallery(
        [(item["image"], item["title"]) for item in data_with_hf_url],
        label="Gallery with HF URLs",
        columns=1
    )
    
    custom_input = gr.Textbox(label="Custom input")
    button = gr.Button("Click me to trigger SSRF error")
    
    button.click(
        test_function,
        inputs=[gallery], 
        outputs=[gallery]  
    )

demo.launch()