Spaces:
Running
Running
Fix prompt
Browse files
app.py
CHANGED
@@ -37,11 +37,10 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
37 |
def create_prompt_for_image_generation(user_prompt: str) -> str:
|
38 |
|
39 |
"""Executes a prompt using a language model to create a detaled prompt
|
40 |
-
for image generation based on user_prompt.
|
41 |
-
Returns prompt for image_generation_tool.
|
42 |
|
43 |
Args:
|
44 |
-
user_prompt:
|
45 |
Output type: str
|
46 |
"""
|
47 |
# Prompt parts
|
@@ -52,13 +51,12 @@ def create_prompt_for_image_generation(user_prompt: str) -> str:
|
|
52 |
2. Tone and Style: Specify the tone (e.g., cinematic, surreal, vibrant) and artistic style (e.g., photorealistic, painterly, abstract).
|
53 |
3. Color Palette: Include details about the dominant colors or overall color scheme.
|
54 |
4. Perspective and Camera Details: Mention the point of view (e.g., wide-angle, close-up), camera type, lens, aperture, and lighting conditions if applicable.
|
55 |
-
5. Additional Details: Highlight any specific objects, text, or unique features with clear emphasis (e.g.,
|
56 |
6. Output Settings: Suggest aspect ratio, output format (e.g., PNG), quality level, and seed for reproducibility.
|
57 |
-
Ensure that the generated prompt is logical, descriptive, and written in natural language to maximize compatibility with FLUX-Schnell
|
58 |
Example Input:
|
59 |
-
|
60 |
Example Output:
|
61 |
-
'''
|
62 |
In the foreground, a lush green forest floor covered with moss and scattered wildflowers.
|
63 |
In the middle ground, a cozy wooden cabin with smoke gently rising from its chimney.
|
64 |
In the background, towering pine trees fading into a misty horizon.
|
@@ -67,7 +65,6 @@ def create_prompt_for_image_generation(user_prompt: str) -> str:
|
|
67 |
The perspective is slightly elevated as if viewed from a drone camera at sunrise,
|
68 |
capturing golden hour lighting for soft shadows and warm highlights.
|
69 |
The aspect ratio is 1:1, using seed 42 for reproducibility.
|
70 |
-
'''
|
71 |
"""
|
72 |
model = HfApiModel(
|
73 |
max_tokens=512,
|
|
|
37 |
def create_prompt_for_image_generation(user_prompt: str) -> str:
|
38 |
|
39 |
"""Executes a prompt using a language model to create a detaled prompt
|
40 |
+
for image generation based on user_prompt. Returns prompt for image_generation_tool.
|
|
|
41 |
|
42 |
Args:
|
43 |
+
user_prompt: A string - the user's text prompt (e.g. 'Giraffe in Louvre in front of Mona Lisa Painting by Leonardo'.
|
44 |
Output type: str
|
45 |
"""
|
46 |
# Prompt parts
|
|
|
51 |
2. Tone and Style: Specify the tone (e.g., cinematic, surreal, vibrant) and artistic style (e.g., photorealistic, painterly, abstract).
|
52 |
3. Color Palette: Include details about the dominant colors or overall color scheme.
|
53 |
4. Perspective and Camera Details: Mention the point of view (e.g., wide-angle, close-up), camera type, lens, aperture, and lighting conditions if applicable.
|
54 |
+
5. Additional Details: Highlight any specific objects, text, or unique features with clear emphasis (e.g., 'with green text' or 'emphasis on golden hour lighting').
|
55 |
6. Output Settings: Suggest aspect ratio, output format (e.g., PNG), quality level, and seed for reproducibility.
|
56 |
+
Ensure that the generated prompt is logical, descriptive, and written in natural language to maximize compatibility with FLUX-Schnell capabilities.
|
57 |
Example Input:
|
58 |
+
An image of a serene forest with a small cabin.'
|
59 |
Example Output:
|
|
|
60 |
In the foreground, a lush green forest floor covered with moss and scattered wildflowers.
|
61 |
In the middle ground, a cozy wooden cabin with smoke gently rising from its chimney.
|
62 |
In the background, towering pine trees fading into a misty horizon.
|
|
|
65 |
The perspective is slightly elevated as if viewed from a drone camera at sunrise,
|
66 |
capturing golden hour lighting for soft shadows and warm highlights.
|
67 |
The aspect ratio is 1:1, using seed 42 for reproducibility.
|
|
|
68 |
"""
|
69 |
model = HfApiModel(
|
70 |
max_tokens=512,
|