Spaces:
Runtime error
Runtime error
Commit
•
54192f0
1
Parent(s):
9aa8809
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,8 @@ MAX_IMAGE_SIZE = 2048
|
|
35 |
|
36 |
@spaces.GPU()
|
37 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_inference_steps=4, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
|
38 |
generator = torch.Generator().manual_seed(seed)
|
39 |
image = pipe(
|
40 |
prompt = prompt,
|
@@ -55,7 +57,7 @@ examples = [
|
|
55 |
css="""
|
56 |
#col-container {
|
57 |
margin: 0 auto;
|
58 |
-
max-width:
|
59 |
}
|
60 |
"""
|
61 |
|
@@ -64,9 +66,8 @@ with gr.Blocks(css=css) as demo:
|
|
64 |
with gr.Column(elem_id="col-container"):
|
65 |
gr.Markdown(f"""
|
66 |
# FLUX.1 Schnell
|
67 |
-
12B
|
68 |
-
|
69 |
-
[[blog](https://blackforestlabs.ai/2024/07/31/announcing-black-forest-labs/)] [[model](https://black-forest-labs/FLUX.1-schnell)]]
|
70 |
""")
|
71 |
|
72 |
with gr.Row():
|
|
|
35 |
|
36 |
@spaces.GPU()
|
37 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_inference_steps=4, progress=gr.Progress(track_tqdm=True)):
|
38 |
+
if randomize_seed:
|
39 |
+
seed = random.randint(0, MAX_SEED)
|
40 |
generator = torch.Generator().manual_seed(seed)
|
41 |
image = pipe(
|
42 |
prompt = prompt,
|
|
|
57 |
css="""
|
58 |
#col-container {
|
59 |
margin: 0 auto;
|
60 |
+
max-width: 550px;
|
61 |
}
|
62 |
"""
|
63 |
|
|
|
66 |
with gr.Column(elem_id="col-container"):
|
67 |
gr.Markdown(f"""
|
68 |
# FLUX.1 Schnell
|
69 |
+
12B param rectified flow transformer distilled from [FLUX.1 Pro](https://blackforestlabs.ai/) for 4 step generation
|
70 |
+
[[blog](https://blackforestlabs.ai/2024/07/31/announcing-black-forest-labs/) [model](https://black-forest-labs/FLUX.1-schnell)]
|
|
|
71 |
""")
|
72 |
|
73 |
with gr.Row():
|