Spaces:
Running
on
Zero
Running
on
Zero
NikhilJoson
commited on
Commit
•
558080e
1
Parent(s):
50896cc
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def gemini_predict(prompt):
|
|
43 |
Query : {prompt}
|
44 |
"""
|
45 |
response = gemini_flash.generate_content(system_message)
|
46 |
-
return(str(response.text)[
|
47 |
|
48 |
|
49 |
MAX_SEED = np.iinfo(np.int32).max
|
@@ -63,6 +63,7 @@ def process(input_image_editor, mask_image, input_text, strength, seed, randomiz
|
|
63 |
if not input_text:
|
64 |
raise gr.Error("Please enter a text prompt.")
|
65 |
item = gemini_predict(input_text)
|
|
|
66 |
|
67 |
image = input_image_editor['background']
|
68 |
if not image:
|
@@ -81,7 +82,7 @@ def process(input_image_editor, mask_image, input_text, strength, seed, randomiz
|
|
81 |
|
82 |
return result, mask_image, seed, item
|
83 |
|
84 |
-
with gr.Blocks(theme=
|
85 |
gr.Markdown(MARKDOWN)
|
86 |
with gr.Row():
|
87 |
with gr.Column(scale=1):
|
@@ -129,8 +130,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
129 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
130 |
with gr.Accordion("Upload a mask", open=False):
|
131 |
uploaded_mask_component = gr.Image(label="Already made mask (black pixels will be preserved, white pixels will be redrawn)", sources=["upload"], type="pil")
|
132 |
-
submit_button_component = gr.Button(
|
133 |
-
value='Inpaint', variant='primary')
|
134 |
with gr.Column(scale=1):
|
135 |
output_image_component = gr.Image(type='pil', image_mode='RGB', label='Generated Image')
|
136 |
output_mask_component = gr.Image(type='pil', image_mode='RGB', label='Generated Mask')
|
|
|
43 |
Query : {prompt}
|
44 |
"""
|
45 |
response = gemini_flash.generate_content(system_message)
|
46 |
+
return(str(response.text)[:-2])
|
47 |
|
48 |
|
49 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
63 |
if not input_text:
|
64 |
raise gr.Error("Please enter a text prompt.")
|
65 |
item = gemini_predict(input_text)
|
66 |
+
#print(item)
|
67 |
|
68 |
image = input_image_editor['background']
|
69 |
if not image:
|
|
|
82 |
|
83 |
return result, mask_image, seed, item
|
84 |
|
85 |
+
with gr.Blocks(theme='upsatwal/mlsc_tiet') as demo:
|
86 |
gr.Markdown(MARKDOWN)
|
87 |
with gr.Row():
|
88 |
with gr.Column(scale=1):
|
|
|
130 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
131 |
with gr.Accordion("Upload a mask", open=False):
|
132 |
uploaded_mask_component = gr.Image(label="Already made mask (black pixels will be preserved, white pixels will be redrawn)", sources=["upload"], type="pil")
|
133 |
+
submit_button_component = gr.Button(value='Inpaint', variant='primary')
|
|
|
134 |
with gr.Column(scale=1):
|
135 |
output_image_component = gr.Image(type='pil', image_mode='RGB', label='Generated Image')
|
136 |
output_mask_component = gr.Image(type='pil', image_mode='RGB', label='Generated Mask')
|