janannfndnd commited on
Commit
a5ae122
·
verified ·
1 Parent(s): 5b164a7

Rename nothing to README.MD

Browse files
Files changed (1) hide show
  1. nothing → README.MD +18 -8
nothing → README.MD RENAMED
@@ -14,15 +14,25 @@ library_name: diffusers
14
  ---
15
 
16
  ```py
17
- from diffusers import AutoPipelineForText2Image
18
  import torch
 
19
 
20
- pipeline = AutoPipelineForText2Image.from_pretrained(
21
- "black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, variant="fp16"
22
- ).to("cuda")
23
- pipeline.load_lora_weights('janannfndnd/SAB', weight_name='lora.safetensors')
24
- image = pipeline(
25
- "prompt", height=768, width=512
 
 
 
 
 
 
 
 
 
 
26
  ).images[0]
27
- image
28
  ```
 
14
  ---
15
 
16
  ```py
 
17
  import torch
18
+ from diffusers import FluxPipeline
19
 
20
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16) # can replace schnell with dev
21
+ # to run on low vram GPUs (i.e. between 4 and 32 GB VRAM)
22
+ pipe.enable_sequential_cpu_offload()
23
+ pipe.vae.enable_slicing()
24
+ pipe.vae.enable_tiling()
25
+
26
+ 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
27
+
28
+ prompt = "A cat holding a sign that says hello world"
29
+ out = pipe(
30
+ prompt=prompt,
31
+ guidance_scale=4,
32
+ height=768,
33
+ width=1024,
34
+ num_inference_steps=4,
35
+ max_sequence_length=256,
36
  ).images[0]
37
+ out.save("image.png")
38
  ```