Spaces:
Sleeping
Sleeping
Update app.py
Browse files53 unmodified lines54555657585960616263644 unmodified lines6970717273747553 unmodified lines# Ensure the output is a valid image (PIL Image)output_image = Image.fromarray(sketch)# Save the processed image temporarilyoutput_image.save("sketch_output.png")# Return the processed sketch imagereturn output_image, "sketch_output.png"# Create Gradio interfaceinterface = gr.Interface(4 unmodified linesgr.Slider(-100, 100, label="Brightness", value=0),gr.Slider(1, 3, step=0.1, label="Contrast", value=1)],outputs=[gr.Image(type="pil", label="Sketch Output"), gr.File(label="Download Sketch")],title="Cartoon to Sketch Converter",description="Upload an image to convert it into a sketch, adjust the blur strength, brightness, and contrast for different effects.")53 unmodified lines54555657585960614 unmodified lines6667686970717253 unmodified lines# Ensure the output is a valid image (PIL Image)output_image = Image.fromarray(sketch)# Return the processed sketch image for displayreturn output_image# Create Gradio interfaceinterface = gr.Interface(4 unmodified linesgr.Slider(-100, 100, label="Brightness", value=0),gr.Slider(1, 3, step=0.1, label="Contrast", value=1)],outputs=[gr.Image(type="pil", label="Sketch Output")], # Output is now just the imagetitle="Cartoon to Sketch Converter",description="Upload an image to convert it into a sketch, adjust the blur strength, brightness, and contrast for different effects.")
app.py+3-6