Update README.md
Browse files
README.md
CHANGED
@@ -79,7 +79,7 @@ for i in range(len((dev_shards))):
|
|
79 |
merged_state_dict.update(guidance_state_dict)
|
80 |
load_model_dict_into_meta(model, merged_state_dict)
|
81 |
|
82 |
-
model.to(torch.bfloat16).save_pretrained("
|
83 |
```
|
84 |
|
85 |
## Inference code
|
@@ -88,14 +88,13 @@ model.to(torch.bfloat16).save_pretrained("/raid/.cache/huggingface/merged-flux")
|
|
88 |
from diffusers import FluxPipeline, FluxTransformer2DModel
|
89 |
import torch
|
90 |
|
91 |
-
transformer = FluxTransformer2DModel.from_pretrained("sayakpaul/FLUX.1-merged", torch_dtype=torch.bfloat16)
|
92 |
pipeline = FluxPipeline.from_pretrained(
|
93 |
-
"
|
94 |
).to("cuda")
|
95 |
image = pipeline(
|
96 |
prompt="a tiny astronaut hatching from an egg on the moon",
|
97 |
guidance_scale=3.5,
|
98 |
-
num_inference_steps=
|
99 |
height=880,
|
100 |
width=1184,
|
101 |
max_sequence_length=512,
|
|
|
79 |
merged_state_dict.update(guidance_state_dict)
|
80 |
load_model_dict_into_meta(model, merged_state_dict)
|
81 |
|
82 |
+
model.to(torch.bfloat16).save_pretrained("merged-flux")
|
83 |
```
|
84 |
|
85 |
## Inference code
|
|
|
88 |
from diffusers import FluxPipeline, FluxTransformer2DModel
|
89 |
import torch
|
90 |
|
|
|
91 |
pipeline = FluxPipeline.from_pretrained(
|
92 |
+
"sayakpaul/FLUX.1-merged", transformer=transformer, torch_dtype=torch.bfloat16
|
93 |
).to("cuda")
|
94 |
image = pipeline(
|
95 |
prompt="a tiny astronaut hatching from an egg on the moon",
|
96 |
guidance_scale=3.5,
|
97 |
+
num_inference_steps=4,
|
98 |
height=880,
|
99 |
width=1184,
|
100 |
max_sequence_length=512,
|