wanghaofan
commited on
Commit
•
6598483
1
Parent(s):
37411d0
Update README.md
Browse files
README.md
CHANGED
@@ -37,8 +37,25 @@ license_link: >-
|
|
37 |
You should use `Chinese line art` to trigger the image generation.
|
38 |
|
39 |
|
40 |
-
##
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
You should use `Chinese line art` to trigger the image generation.
|
38 |
|
39 |
|
40 |
+
## Inference
|
41 |
+
|
42 |
+
```python
|
43 |
+
import torch
|
44 |
+
from diffusers import StableDiffusion3Pipeline # please install diffusers from the source
|
45 |
+
|
46 |
+
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large-diffusers", torch_dtype=torch.bfloat16)
|
47 |
+
pipe.load_lora_weights("Shakker-Labs/SD3.5-LoRA-Chinese-Line-Art", weight_name="SD35-lora-Chinese-Line-Art.safetensors")
|
48 |
+
pipe.fuse_lora(lora_scale=1.0)
|
49 |
+
pipe.to("cuda")
|
50 |
+
|
51 |
+
prompt = "a boat on the river, mountain in the distance, Chinese line art"
|
52 |
+
negative_prompt = "(lowres, low quality, worst quality)"
|
53 |
+
|
54 |
+
image = pipe(prompt=prompt,
|
55 |
+
negative_prompt=negative_prompt
|
56 |
+
num_inference_steps=24,
|
57 |
+
guidance_scale=4.0,
|
58 |
+
width=960, height=1280,
|
59 |
+
).images[0]
|
60 |
+
image.save(f"toy_example.jpg")
|
61 |
+
```
|