Spaces:
Runtime error
Runtime error
Add code for SD v1.5 and main method
Browse files
app.py
CHANGED
@@ -24,4 +24,17 @@ pipe = pipe.to(device)
|
|
24 |
torch.backends.cudnn.benchmark = True
|
25 |
|
26 |
# SD v1.5
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
torch.backends.cudnn.benchmark = True
|
25 |
|
26 |
# SD v1.5
|
27 |
+
def get_stable_diffusion_v15_pipeline():
|
28 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
29 |
+
pipeline = DiffusionPipeline.from_pretrained(mode_id)
|
30 |
+
pipeline = pipeline.to(device)
|
31 |
+
return pipeline
|
32 |
+
|
33 |
+
# main
|
34 |
+
def main():
|
35 |
+
prompt = "Hello world, I'm vizard,"
|
36 |
+
|
37 |
+
pipeline = get_stable_diffusion_v15_pipeline()
|
38 |
+
images = pipeline(prompt).images
|
39 |
+
|
40 |
+
main
|