Spaces:
Running
on
Zero
Running
on
Zero
undo
Browse files
app.py
CHANGED
@@ -10,11 +10,11 @@ from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_
|
|
10 |
dtype = torch.bfloat16
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
)
|
17 |
-
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
MAX_IMAGE_SIZE = 2048
|
20 |
|
@@ -54,7 +54,10 @@ css="""
|
|
54 |
with gr.Blocks(css=css) as demo:
|
55 |
|
56 |
with gr.Column(elem_id="col-container"):
|
57 |
-
gr.Markdown(f"""#
|
|
|
|
|
|
|
58 |
|
59 |
with gr.Row():
|
60 |
|
@@ -107,7 +110,7 @@ with gr.Blocks(css=css) as demo:
|
|
107 |
minimum=1,
|
108 |
maximum=15,
|
109 |
step=0.1,
|
110 |
-
value=
|
111 |
)
|
112 |
|
113 |
num_inference_steps = gr.Slider(
|
|
|
10 |
dtype = torch.bfloat16
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
+
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
14 |
+
good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=dtype).to(device)
|
15 |
+
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=dtype, vae=taef1).to(device)
|
16 |
+
torch.cuda.empty_cache()
|
17 |
+
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
MAX_IMAGE_SIZE = 2048
|
20 |
|
|
|
54 |
with gr.Blocks(css=css) as demo:
|
55 |
|
56 |
with gr.Column(elem_id="col-container"):
|
57 |
+
gr.Markdown(f"""# FLUX.1 [dev]
|
58 |
+
12B param rectified flow transformer guidance-distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/)
|
59 |
+
[[non-commercial license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)] [[blog](https://blackforestlabs.ai/announcing-black-forest-labs/)] [[model](https://huggingface.co/black-forest-labs/FLUX.1-dev)]
|
60 |
+
""")
|
61 |
|
62 |
with gr.Row():
|
63 |
|
|
|
110 |
minimum=1,
|
111 |
maximum=15,
|
112 |
step=0.1,
|
113 |
+
value=3.5,
|
114 |
)
|
115 |
|
116 |
num_inference_steps = gr.Slider(
|