Text-to-Image
Diffusers
ChenruiMa commited on
Commit
e35bdda
·
verified ·
1 Parent(s): efd8d75

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -0
README.md CHANGED
@@ -22,6 +22,20 @@ The file `galaxsd_final.safetensors` contains the fine-tuned Stable Diffusion we
22
  pip install diffusers transformers accelerate safetensors
23
  ```
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
 
27
  ## 🔗 Project Resources
 
22
  pip install diffusers transformers accelerate safetensors
23
  ```
24
 
25
+ 2. Load and run the model:
26
+ ```bash
27
+ from diffusers import StableDiffusionPipeline
28
+ import torch
29
+
30
+ pipe = StableDiffusionPipeline.from_single_file(
31
+ "galaxsd_final.safetensors",
32
+ torch_dtype=torch.float16
33
+ ).to("cuda")
34
+
35
+ prompt = "sdss, spiral galaxy, loosely wound spiral arms, 2 spiral arms"
36
+ image = pipe(prompt).images[0]
37
+ image.save("output.png")
38
+ ```
39
 
40
 
41
  ## 🔗 Project Resources