Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", tor
|
|
14 |
@spaces.GPU
|
15 |
def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
16 |
print(edit_images)
|
17 |
-
image = edit_images["
|
18 |
-
mask = edit_images["
|
19 |
if randomize_seed:
|
20 |
seed = random.randint(0, MAX_SEED)
|
21 |
image = pipe(
|
@@ -58,7 +58,8 @@ with gr.Blocks(css=css) as demo:
|
|
58 |
sources=["upload", "webcam"],
|
59 |
image_mode='RGB',
|
60 |
layers=False,
|
61 |
-
brush=gr.Brush(colors=["#FFFFFF"], color_mode="fixed")
|
|
|
62 |
)
|
63 |
prompt = gr.Text(
|
64 |
label="Prompt",
|
@@ -69,7 +70,7 @@ with gr.Blocks(css=css) as demo:
|
|
69 |
)
|
70 |
run_button = gr.Button("Run", scale=0)
|
71 |
|
72 |
-
|
73 |
|
74 |
with gr.Accordion("Advanced Settings", open=False):
|
75 |
|
|
|
14 |
@spaces.GPU
|
15 |
def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
16 |
print(edit_images)
|
17 |
+
image = edit_images["background"]
|
18 |
+
mask = edit_images["layers"][0]
|
19 |
if randomize_seed:
|
20 |
seed = random.randint(0, MAX_SEED)
|
21 |
image = pipe(
|
|
|
58 |
sources=["upload", "webcam"],
|
59 |
image_mode='RGB',
|
60 |
layers=False,
|
61 |
+
brush=gr.Brush(colors=["#FFFFFF"], color_mode="fixed"),
|
62 |
+
height=750
|
63 |
)
|
64 |
prompt = gr.Text(
|
65 |
label="Prompt",
|
|
|
70 |
)
|
71 |
run_button = gr.Button("Run", scale=0)
|
72 |
|
73 |
+
result = gr.Image(label="Result", show_label=False)
|
74 |
|
75 |
with gr.Accordion("Advanced Settings", open=False):
|
76 |
|