Equityone commited on
Commit
e15a130
·
verified ·
1 Parent(s): d814350

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -93,11 +93,14 @@ class ImageGenerator:
93
  def _build_prompt(self, params: Dict[str, Any]) -> str:
94
  style_info = ART_STYLES.get(params["style"], ART_STYLES["Neo Vintage"])
95
  prompt = f"{style_info['prompt_prefix']}, {params['subject']}"
96
-
97
- for param_type in ['layout', 'ambiance', 'palette']:
98
- if params.get(param_type):
99
- prompt += f", {COMPOSITION_PARAMS[param_type.capitalize()][params[param_type]]}"
100
-
 
 
 
101
  for param, description in [
102
  ("detail_level", "highly detailed" if params.get("detail_level", 0) > 7 else "moderately detailed"),
103
  ("contrast", "high contrast" if params.get("contrast", 0) > 7 else "balanced contrast"),
@@ -105,10 +108,10 @@ class ImageGenerator:
105
  ]:
106
  if params.get(param):
107
  prompt += f", {description}"
108
-
109
  if params.get("title"):
110
  prompt += f", with text saying '{params['title']}'"
111
-
112
  logger.debug(f"Prompt final: {prompt}")
113
  return prompt
114
 
 
93
  def _build_prompt(self, params: Dict[str, Any]) -> str:
94
  style_info = ART_STYLES.get(params["style"], ART_STYLES["Neo Vintage"])
95
  prompt = f"{style_info['prompt_prefix']}, {params['subject']}"
96
+
97
+ if params.get("layout"):
98
+ prompt += f", {COMPOSITION_PARAMS['Layouts'][params['layout']]}"
99
+ if params.get("ambiance"):
100
+ prompt += f", {COMPOSITION_PARAMS['Ambiances'][params['ambiance']]}"
101
+ if params.get("palette"):
102
+ prompt += f", {COMPOSITION_PARAMS['Palette'][params['palette']]}"
103
+
104
  for param, description in [
105
  ("detail_level", "highly detailed" if params.get("detail_level", 0) > 7 else "moderately detailed"),
106
  ("contrast", "high contrast" if params.get("contrast", 0) > 7 else "balanced contrast"),
 
108
  ]:
109
  if params.get(param):
110
  prompt += f", {description}"
111
+
112
  if params.get("title"):
113
  prompt += f", with text saying '{params['title']}'"
114
+
115
  logger.debug(f"Prompt final: {prompt}")
116
  return prompt
117