vs4vijay commited on
Commit
38a84a5
·
1 Parent(s): d86203b

Add code for SD v1.5 and main method

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -24,4 +24,17 @@ pipe = pipe.to(device)
24
  torch.backends.cudnn.benchmark = True
25
 
26
  # SD v1.5
27
- pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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