lixiang46 commited on
Commit
2990da4
1 Parent(s): 4ec028f

fix imageeditor

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -46,13 +46,10 @@ def infer(prompt,
46
  if randomize_seed:
47
  seed = random.randint(0, MAX_SEED)
48
  generator = torch.Generator().manual_seed(seed)
49
- print(type(image))
50
- for k,v in image:
51
- print(k, type(v))
52
  result = pipe(
53
  prompt = prompt,
54
- image = image['image'],
55
- mask_image = image['mask'],
56
  height=height,
57
  width=width,
58
  guidance_scale = guidance_scale,
@@ -95,7 +92,7 @@ with gr.Blocks(css=css) as Kolors:
95
  lines=2
96
  )
97
  with gr.Row():
98
- image = gr.ImageEditor(type="pil", label="Image to Inpaint")
99
  with gr.Accordion("Advanced Settings", open=False):
100
  negative_prompt = gr.Textbox(
101
  label="Negative prompt",
 
46
  if randomize_seed:
47
  seed = random.randint(0, MAX_SEED)
48
  generator = torch.Generator().manual_seed(seed)
 
 
 
49
  result = pipe(
50
  prompt = prompt,
51
+ image = image['background'],
52
+ mask_image = image['layers'][0],
53
  height=height,
54
  width=width,
55
  guidance_scale = guidance_scale,
 
92
  lines=2
93
  )
94
  with gr.Row():
95
+ image = gr.ImageEditor(type='pil', image_mode='RGB', layers=False, brush=gr.Brush(colors=["#AAAAAA"], color_mode="fixed"))
96
  with gr.Accordion("Advanced Settings", open=False):
97
  negative_prompt = gr.Textbox(
98
  label="Negative prompt",