Spaces:
Sleeping
Sleeping
Update app.py
Browse files53 unmodified lines545556575859606157585960614 unmodified lines666768726970717253 unmodified lines # Ensure the output is a valid image (PIL Image) output_image = Image.fromarray(sketch) # Save the processed image temporarily output_image.save("sketch_output.png") # Return the processed sketch image return output_image, "sketch_output.png" # Return the processed sketch image for display return output_image
# Create Gradio interfaceinterface = gr.Interface(4 unmodified lines gr.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")], outputs=[gr.Image(type="pil", label="Sketch Output")], # Output is now just the image 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.")app.py+3-6