Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,10 @@ from diffusers import DiffusionPipeline
|
|
6 |
import torch
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
-
model_repo_id = "
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
-
torch_dtype = torch.
|
13 |
else:
|
14 |
torch_dtype = torch.float32
|
15 |
|
@@ -60,36 +60,35 @@ with gr.Blocks(css=css) as demo:
|
|
60 |
# FLUX.1 [dev] with CFG (and negative prompts)
|
61 |
""")
|
62 |
|
|
|
63 |
with gr.Row():
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
value=5.0, #Replace with defaults that work for your model
|
92 |
-
)
|
93 |
run_button = gr.Button("Run", scale=0)
|
94 |
|
95 |
result = gr.Image(label="Result", show_label=False)
|
|
|
6 |
import torch
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
+
model_repo_id = "black-forest-labs/FLUX.1-dev" #Replace to the model you would like to use
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
+
torch_dtype = torch.bfloat16
|
13 |
else:
|
14 |
torch_dtype = torch.float32
|
15 |
|
|
|
60 |
# FLUX.1 [dev] with CFG (and negative prompts)
|
61 |
""")
|
62 |
|
63 |
+
#with gr.Row():
|
64 |
with gr.Row():
|
65 |
+
prompt = gr.Text(
|
66 |
+
label="Prompt",
|
67 |
+
show_label=False,
|
68 |
+
max_lines=1,
|
69 |
+
placeholder="Enter your prompt",
|
70 |
+
container=False,
|
71 |
+
)
|
72 |
+
negative_prompt = gr.Text(
|
73 |
+
label="Negative prompt",
|
74 |
+
max_lines=1,
|
75 |
+
placeholder="Enter a negative prompt",
|
76 |
+
)
|
77 |
+
with gr.Row():
|
78 |
+
guidance_scale = gr.Slider(
|
79 |
+
label="Guidance scale",
|
80 |
+
minimum=0.0,
|
81 |
+
maximum=10.0,
|
82 |
+
step=0.1,
|
83 |
+
value=1.0, #Replace with defaults that work for your model
|
84 |
+
)
|
85 |
+
true_guidance = gr.Slider(
|
86 |
+
label="True CFG scale",
|
87 |
+
minimum=0.0,
|
88 |
+
maximum=10.0,
|
89 |
+
step=0.1,
|
90 |
+
value=5.0, #Replace with defaults that work for your model
|
91 |
+
)
|
|
|
|
|
92 |
run_button = gr.Button("Run", scale=0)
|
93 |
|
94 |
result = gr.Image(label="Result", show_label=False)
|