Update README.md
Browse files
README.md
CHANGED
|
@@ -14,30 +14,10 @@ library_name: diffusers
|
|
| 14 |
---
|
| 15 |
|
| 16 |
```py
|
|
|
|
| 17 |
import torch
|
| 18 |
-
from diffusers import FluxPipeline
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
pipe.load_lora_weights(VideoAditor/Flux-Lora-Realism/flux_realism_lora.safetensors)
|
| 24 |
-
pipe.fuse_lora(lora_scale=1)
|
| 25 |
-
|
| 26 |
-
# to run on low vram GPUs (i.e. between 4 and 32 GB VRAM)
|
| 27 |
-
pipe.enable_sequential_cpu_offload()
|
| 28 |
-
pipe.vae.enable_slicing()
|
| 29 |
-
pipe.vae.enable_tiling()
|
| 30 |
-
|
| 31 |
-
pipe.to(torch.float16) # casting here instead of in the pipeline constructor because doing so in the constructor loads all models into CPU memory at once
|
| 32 |
-
|
| 33 |
-
prompt = ""
|
| 34 |
-
out = pipe(
|
| 35 |
-
prompt=prompt,
|
| 36 |
-
guidance_scale=4.5,
|
| 37 |
-
height=512,
|
| 38 |
-
width=512,
|
| 39 |
-
num_inference_steps=10,
|
| 40 |
-
max_sequence_length=256,
|
| 41 |
-
).images[0]
|
| 42 |
-
out.save("image.png")
|
| 43 |
```
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
```py
|
| 17 |
+
from diffusers import AutoPipelineForText2Image
|
| 18 |
import torch
|
|
|
|
| 19 |
|
| 20 |
+
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.float16).to('cuda')
|
| 21 |
+
pipeline.load_lora_weights('janannfndnd/SABA', weight_name='lora.safetensors')
|
| 22 |
+
image = pipeline("your prompt").images[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
```
|