multimodalart HF staff commited on
Commit
addfecb
1 Parent(s): 7a7c75c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -13,8 +13,9 @@ pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", tor
13
 
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
- image = edit_images[0]
17
- mask = edit_images[1]
 
18
  if randomize_seed:
19
  seed = random.randint(0, MAX_SEED)
20
  image = pipe(
@@ -49,26 +50,25 @@ with gr.Blocks(css=css) as demo:
49
  12B param rectified flow transformer structural conditioning tuned, guidance-distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/)
50
  [[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)]
51
  """)
52
-
53
- edit_image = gr.ImageEditor(
54
- label='Upload and draw mask for inpainting',
55
- type='pil',
56
- sources=["upload", "webcam"],
57
- image_mode='RGB',
58
- layers=False,
59
- brush=gr.Brush(colors=["#FFFFFF"], color_mode="fixed"))
60
  with gr.Row():
61
-
62
- prompt = gr.Text(
63
- label="Prompt",
64
- show_label=False,
65
- max_lines=1,
66
- placeholder="Enter your prompt",
67
- container=False,
68
- )
69
-
70
- run_button = gr.Button("Run", scale=0)
71
-
 
 
 
 
 
 
 
72
  result = gr.Image(label="Result", show_label=False)
73
 
74
  with gr.Accordion("Advanced Settings", open=False):
 
13
 
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["image"]
18
+ mask = edit_images["mask"]
19
  if randomize_seed:
20
  seed = random.randint(0, MAX_SEED)
21
  image = pipe(
 
50
  12B param rectified flow transformer structural conditioning tuned, guidance-distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/)
51
  [[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)]
52
  """)
 
 
 
 
 
 
 
 
53
  with gr.Row():
54
+ with gr.Column():
55
+ edit_image = gr.ImageEditor(
56
+ label='Upload and draw mask for inpainting',
57
+ type='pil',
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",
65
+ show_label=False,
66
+ max_lines=1,
67
+ placeholder="Enter your prompt",
68
+ container=False,
69
+ )
70
+ run_button = gr.Button("Run", scale=0)
71
+
72
  result = gr.Image(label="Result", show_label=False)
73
 
74
  with gr.Accordion("Advanced Settings", open=False):