Yihong Luo
commited on
Commit
•
581062e
1
Parent(s):
4dff679
Update README.md
Browse files
README.md
CHANGED
@@ -8,6 +8,7 @@
|
|
8 |
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype = torch.float16)
|
9 |
pipeline = pipeline.to('cuda')
|
10 |
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
|
|
11 |
generator = torch.manual_seed(318)
|
12 |
steps = 1
|
13 |
bs = 1
|
@@ -25,12 +26,30 @@ imgs= pipeline(prompt="A photo of a dog",
|
|
25 |
imgs
|
26 |
```
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
### 2-step inference
|
29 |
We note that a small CFG can be used to enhance the image quality.
|
30 |
```python
|
31 |
pipeline = DiffusionPipeline.from_pretrained("stablediffusionapi/realistic-vision-v51", torch_dtype = torch.float16)
|
32 |
pipeline = pipeline.to('cuda')
|
33 |
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
|
|
34 |
generator = torch.manual_seed(318)
|
35 |
steps = 2
|
36 |
imgs= pipeline(prompt="A photo of a man, XT3",
|
|
|
8 |
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype = torch.float16)
|
9 |
pipeline = pipeline.to('cuda')
|
10 |
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
11 |
+
pipeline.load_lora_weights('Yihong666/yoso_sd1.5_lora')
|
12 |
generator = torch.manual_seed(318)
|
13 |
steps = 1
|
14 |
bs = 1
|
|
|
26 |
imgs
|
27 |
```
|
28 |
|
29 |
+
The simple inference without informative initialization, but worse quality:
|
30 |
+
```python
|
31 |
+
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype = torch.float16)
|
32 |
+
pipeline = pipeline.to('cuda')
|
33 |
+
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
34 |
+
pipeline.load_lora_weights('Yihong666/yoso_sd1.5_lora')
|
35 |
+
generator = torch.manual_seed(318)
|
36 |
+
steps = 1
|
37 |
+
imgs_noise = pipeline(prompt="A photo of a corgi in forest, highly detailed, 8k, XT3.",
|
38 |
+
num_inference_steps=1,
|
39 |
+
num_images_per_prompt = 1,
|
40 |
+
generator = generator,
|
41 |
+
guidance_scale=1.,
|
42 |
+
)[0]
|
43 |
+
imgs_noise[0]
|
44 |
+
```
|
45 |
+
|
46 |
### 2-step inference
|
47 |
We note that a small CFG can be used to enhance the image quality.
|
48 |
```python
|
49 |
pipeline = DiffusionPipeline.from_pretrained("stablediffusionapi/realistic-vision-v51", torch_dtype = torch.float16)
|
50 |
pipeline = pipeline.to('cuda')
|
51 |
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
52 |
+
pipeline.load_lora_weights('Yihong666/yoso_sd1.5_lora')
|
53 |
generator = torch.manual_seed(318)
|
54 |
steps = 2
|
55 |
imgs= pipeline(prompt="A photo of a man, XT3",
|