Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -69,12 +69,27 @@ if uploaded_file is not None:
|
|
69 |
hair_color = query_analysis(image_bytes, "What is the hair color and hair style of the person?")
|
70 |
facial_expression = query_analysis(image_bytes, "What is the facial expression and facial features of the person?")
|
71 |
age = query_analysis(image_bytes, "What is the estimated age of the person?")
|
|
|
72 |
|
73 |
-
# Build generation prompt based on VQA responses and user input
|
74 |
if gender.lower() == "female":
|
75 |
-
prompt =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
else:
|
77 |
-
prompt =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
# Call image generation API
|
80 |
with st.spinner("Generating the image..."):
|
|
|
69 |
hair_color = query_analysis(image_bytes, "What is the hair color and hair style of the person?")
|
70 |
facial_expression = query_analysis(image_bytes, "What is the facial expression and facial features of the person?")
|
71 |
age = query_analysis(image_bytes, "What is the estimated age of the person?")
|
72 |
+
background = query_analysis(image_bytes, "What is the background or setting of the image?")
|
73 |
|
74 |
+
# Build the generation prompt based on VQA responses and user input
|
75 |
if gender.lower() == "female":
|
76 |
+
prompt = (
|
77 |
+
f"Generate a highly creative and artistic full-body image of a {age}-year-old girl. "
|
78 |
+
f"She has {hair_color} hair, styled uniquely. She is wearing {clothing} that complements her personality. "
|
79 |
+
f"Her facial expression shows {facial_expression}, with distinct facial features. "
|
80 |
+
f"Place her in a visually compelling {background}, enhancing the mood and atmosphere of the image. "
|
81 |
+
f"Use dynamic lighting, textures, and vivid colors to create an image that feels alive. "
|
82 |
+
f"{user_prompt}."
|
83 |
+
)
|
84 |
else:
|
85 |
+
prompt = (
|
86 |
+
f"Generate a highly creative and artistic full-body image of a {age}-year-old person. "
|
87 |
+
f"They have {hair_color} hair, styled uniquely. They are wearing {clothing} that complements their personality. "
|
88 |
+
f"Their facial expression shows {facial_expression}, with distinct facial features. "
|
89 |
+
f"Place them in a visually compelling {background}, enhancing the mood and atmosphere of the image. "
|
90 |
+
f"Use dynamic lighting, textures, and vivid colors to create an image that feels alive. "
|
91 |
+
f"{user_prompt}."
|
92 |
+
)
|
93 |
|
94 |
# Call image generation API
|
95 |
with st.spinner("Generating the image..."):
|