wanghaofan
commited on
Commit
•
a00ffb6
1
Parent(s):
5cf779a
Update README.md
Browse files
README.md
CHANGED
@@ -52,8 +52,25 @@ license_link: >-
|
|
52 |
You should use `Linear red light` to trigger the image generation.
|
53 |
|
54 |
|
55 |
-
##
|
56 |
|
57 |
-
|
|
|
|
|
58 |
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
You should use `Linear red light` to trigger the image generation.
|
53 |
|
54 |
|
55 |
+
## Inference
|
56 |
|
57 |
+
```python
|
58 |
+
import torch
|
59 |
+
from diffusers import StableDiffusion3Pipeline # please install diffusers from the source
|
60 |
|
61 |
+
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large-diffusers", torch_dtype=torch.bfloat16)
|
62 |
+
pipe.load_lora_weights("Shakker-Labs/SD3.5-LoRA-Linear-Red-Light", weight_name="SD35-lora-Linear-Red-Light.safetensors")
|
63 |
+
pipe.fuse_lora(lora_scale=1.0)
|
64 |
+
pipe.to("cuda")
|
65 |
+
|
66 |
+
prompt = "a cat, Linear red light"
|
67 |
+
negative_prompt = "(lowres, low quality, worst quality)"
|
68 |
+
|
69 |
+
image = pipe(prompt=prompt,
|
70 |
+
negative_prompt=negative_prompt
|
71 |
+
num_inference_steps=24,
|
72 |
+
guidance_scale=4.0,
|
73 |
+
width=960, height=1280,
|
74 |
+
).images[0]
|
75 |
+
image.save(f"toy_example.jpg")
|
76 |
+
```
|