Spaces:
Running
Running
import gradio as gr | |
# Load the RunwayML model using Gradio | |
model = gr.load("models/runwayml/stable-diffusion-v1-5") | |
# Custom HTML and CSS for styling | |
custom_html = """ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
background-color: #f4f4f4; | |
text-align: center; | |
margin: 0; | |
padding: 0; | |
} | |
.container { | |
max-width: 600px; | |
margin: auto; | |
padding: 20px; | |
background-color: #fff; | |
border-radius: 10px; | |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | |
margin-top: 50px; | |
} | |
h1 { | |
color: #333; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Stable Diffusion Model</h1> | |
{input} | |
{output} | |
</div> | |
</body> | |
</html> | |
""" | |
# Launch the interface with the loaded model and custom styling | |
iface = gr.Interface(fn=model, inputs=model.interface.inputs, outputs=model.interface.outputs) | |
iface.share(html=custom_html) |