Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,3 +24,14 @@ interface = gr.Interface(
|
|
24 |
# Launch the interface
|
25 |
if __name__ == "__main__":
|
26 |
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
# Launch the interface
|
25 |
if __name__ == "__main__":
|
26 |
interface.launch()
|
27 |
+
model = StableDiffusionPipeline.from_pretrained("SG161222/Realistic_Vision_V4.0")
|
28 |
+
|
29 |
+
import torch
|
30 |
+
from diffusers import StableDiffusionPipeline
|
31 |
+
|
32 |
+
model = StableDiffusionPipeline.from_pretrained("SG161222/Realistic_Vision_V4.0").to("cuda")
|
33 |
+
model.unet = torch.compile(model.unet) # Speeds up inference
|
34 |
+
|
35 |
+
def generate_image(prompt):
|
36 |
+
image = model(prompt).images[0]
|
37 |
+
return image
|