kpsss34 commited on
Commit
d548522
·
verified ·
1 Parent(s): 2f599a1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -1
README.md CHANGED
@@ -32,4 +32,31 @@ and one 32x spatial-compressed latent feature encoder ([DC-AE](https://hanlab.mi
32
 
33
  For research purposes, we recommend our `generative-models` Github repository (https://github.com/NVlabs/Sana),
34
  which is more suitable for both training and inference and for which most advanced diffusion sampler like Flow-DPM-Solver is integrated.
35
- [MIT Han-Lab](https://nv-sana.mit.edu/) provides free Sana inference.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  For research purposes, we recommend our `generative-models` Github repository (https://github.com/NVlabs/Sana),
34
  which is more suitable for both training and inference and for which most advanced diffusion sampler like Flow-DPM-Solver is integrated.
35
+ [MIT Han-Lab](https://nv-sana.mit.edu/) provides free Sana inference.
36
+ ```python
37
+ # pip install git+https://github.com/huggingface/diffusers
38
+ # pip install transformer
39
+ import torch
40
+ from diffusers import SanaPAGPipeline
41
+
42
+ pipe = SanaPAGPipeline.from_pretrained(
43
+ "kpsss34/SANA600.fp8_Realistic_SFW_V1",
44
+ torch_dtype=torch.float16,
45
+ )
46
+ pipe.to("cuda")
47
+
48
+ pipe.text_encoder.to(torch.bfloat16)
49
+ pipe.vae.to(torch.bfloat16)
50
+
51
+ prompt = 'A cute 🐼 eating 🎋, ink drawing style'
52
+ image = pipe(
53
+ prompt=prompt,
54
+ height=1024,
55
+ width=1024,
56
+ guidance_scale=5.0,
57
+ pag_scale=2.0,
58
+ num_inference_steps=20,
59
+ generator=torch.Generator(device="cuda").manual_seed(42),
60
+ )[0]
61
+ image[0].save('sana.png')
62
+ ```