Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from io import BytesIO
|
|
6 |
import tempfile
|
7 |
import concurrent.futures
|
8 |
|
9 |
-
client = genai.Client(API_KEY)
|
10 |
PROMPT_VARIATIONS = [
|
11 |
"Generate a high quality image with a minimalist white background, bright natural light, and an open lid. Keep the product text unchanged.",
|
12 |
"Generate a high quality image of a beautiful woman who is using the product. The product and its text must remain exactly as in the original image.",
|
@@ -27,7 +27,7 @@ def process_variation(variation, input_image, product_name):
|
|
27 |
variation
|
28 |
)
|
29 |
response = client.models.generate_content(
|
30 |
-
model=univin,
|
31 |
contents=[text_input, input_image],
|
32 |
config=types.GenerateContentConfig(response_modalities=['Text', 'Image'])
|
33 |
)
|
@@ -50,7 +50,7 @@ def generate_images(input_image, product_name):
|
|
50 |
return output_files
|
51 |
|
52 |
with gr.Blocks() as demo:
|
53 |
-
gr.Markdown("#
|
54 |
with gr.Row():
|
55 |
input_image = gr.Image(type="pil", label="Upload Image")
|
56 |
product_name = gr.Textbox(label="Product Name", placeholder="Enter the product name")
|
|
|
6 |
import tempfile
|
7 |
import concurrent.futures
|
8 |
|
9 |
+
client = genai.Client(os.environ.getattribute(API_KEY))
|
10 |
PROMPT_VARIATIONS = [
|
11 |
"Generate a high quality image with a minimalist white background, bright natural light, and an open lid. Keep the product text unchanged.",
|
12 |
"Generate a high quality image of a beautiful woman who is using the product. The product and its text must remain exactly as in the original image.",
|
|
|
27 |
variation
|
28 |
)
|
29 |
response = client.models.generate_content(
|
30 |
+
model=os.environ.getattribute(univin),
|
31 |
contents=[text_input, input_image],
|
32 |
config=types.GenerateContentConfig(response_modalities=['Text', 'Image'])
|
33 |
)
|
|
|
50 |
return output_files
|
51 |
|
52 |
with gr.Blocks() as demo:
|
53 |
+
gr.Markdown("#Uni-Imaginator")
|
54 |
with gr.Row():
|
55 |
input_image = gr.Image(type="pil", label="Upload Image")
|
56 |
product_name = gr.Textbox(label="Product Name", placeholder="Enter the product name")
|