Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -47,6 +47,8 @@ def infer(prompt,
|
|
47 |
seed = random.randint(0, MAX_SEED)
|
48 |
generator = torch.Generator().manual_seed(seed)
|
49 |
width, height = image['background'].size
|
|
|
|
|
50 |
result = pipe(
|
51 |
prompt = prompt,
|
52 |
image = image['background'],
|
@@ -101,7 +103,7 @@ with gr.Blocks(css=css) as Kolors:
|
|
101 |
lines=2
|
102 |
)
|
103 |
with gr.Row():
|
104 |
-
image = gr.ImageEditor(label='Image', type='pil', image_mode='RGB', layers=False, brush=gr.Brush(colors=["#AAAAAA"], color_mode="fixed"))
|
105 |
mask_image = gr.Image(label='Mask_Example',type='pil', visible=False, value=None)
|
106 |
with gr.Accordion("Advanced Settings", open=False):
|
107 |
negative_prompt = gr.Textbox(
|
|
|
47 |
seed = random.randint(0, MAX_SEED)
|
48 |
generator = torch.Generator().manual_seed(seed)
|
49 |
width, height = image['background'].size
|
50 |
+
width = (width // 8 + 1) * 8
|
51 |
+
height = (height // 8 + 1) * 8
|
52 |
result = pipe(
|
53 |
prompt = prompt,
|
54 |
image = image['background'],
|
|
|
103 |
lines=2
|
104 |
)
|
105 |
with gr.Row():
|
106 |
+
image = gr.ImageEditor(label='Image', type='pil', sources=["upload", "webcam"], image_mode='RGB', layers=False, brush=gr.Brush(colors=["#AAAAAA"], color_mode="fixed"))
|
107 |
mask_image = gr.Image(label='Mask_Example',type='pil', visible=False, value=None)
|
108 |
with gr.Accordion("Advanced Settings", open=False):
|
109 |
negative_prompt = gr.Textbox(
|