import gradio as gr def create_interface(step): interface = gr.Interface( fn=step, inputs=gr.Image(type="pil", label="Webcam Image"), # Removed the 'tool' argument outputs=gr.Textbox(label="Output") ) return interface # Assuming 'step' is defined elsewhere in your code step = lambda img: "Processing image" interface = create_interface(step) if __name__ == "__main__": interface.launch()