MohamedRashad commited on
Commit
c493a61
·
1 Parent(s): 836dd96

Refine prompt enhancement guidelines in app.py to focus on visual and sensory features; clarify output structure and examples

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -363,7 +363,7 @@ def load_transformer(vae, args):
363
  def enhance_prompt(prompt):
364
  SYSTEM = """You are part of a team of bots that creates images. You work with an assistant bot that will draw anything you say.
365
 
366
- When given a user prompt, your role is to transform it into a creative, detailed, and vivid image description. Additionally, you will assign a configuration value (`cfg`) based on the type of image.
367
 
368
  ### Guidelines for Generating the Output:
369
 
@@ -374,12 +374,12 @@ When given a user prompt, your role is to transform it into a creative, detailed
374
  "prompt": "<enhanced image description>",
375
  "cfg": <cfg value>
376
  }
377
- ```
378
 
379
  2. **Enhancing the "prompt" field:**
380
- - Use your creativity to transform short or vague prompts into highly detailed, descriptive, and imaginative image descriptions.
381
- - Preserve the original intent and meaning of the user’s input.
382
- - Focus on vivid imagery, sensory details, and emotional resonance in your descriptions.
383
  - For particularly long user prompts (over 50 words), output them directly without refinement.
384
  - Image descriptions must remain between 8-512 words. Any excess text will be ignored.
385
  - If the user's request involves rendering specific text in the image, enclose that text in single quotation marks and prefix it with "the text".
@@ -390,15 +390,15 @@ When given a user prompt, your role is to transform it into a creative, detailed
390
 
391
  4. **Examples of Enhanced Prompts:**
392
  - **User prompt:** "a tree"
393
- **Enhanced prompt:** "A photo of a majestic oak tree stands proudly in the middle of a sunlit meadow, its branches stretching out like welcoming arms. The leaves shimmer in shades of vibrant green, casting dappled shadows on the soft grass below."
394
  **Cfg:** `3`
395
 
396
- - **User prompt:** "a cat by the window"
397
- **Enhanced prompt:** "A serene scene of a fluffy tabby cat perched on the windowsill, gazing out at the golden hues of a sunset. The soft light filters through lace curtains, highlighting the cat’s delicate whiskers and its relaxed posture."
398
- **Cfg:** `3`
399
 
400
  5. **Your Output:**
401
- Always return a single dictionary containing both `"prompt"` and `"cfg"` fields. Avoid any additional commentary or explanations.
402
 
403
  Don't write anything except the dictionary in the output. (Don't start with ```)
404
  """
 
363
  def enhance_prompt(prompt):
364
  SYSTEM = """You are part of a team of bots that creates images. You work with an assistant bot that will draw anything you say.
365
 
366
+ When given a user prompt, your role is to transform it into a creative, detailed, and vivid image description that focuses on visual and sensory features. Avoid directly referencing specific real-world people, places, or cultural knowledge unless explicitly requested by the user.
367
 
368
  ### Guidelines for Generating the Output:
369
 
 
374
  "prompt": "<enhanced image description>",
375
  "cfg": <cfg value>
376
  }
377
+ ```
378
 
379
  2. **Enhancing the "prompt" field:**
380
+ - Use your creativity to expand short or vague prompts into highly detailed, visually rich descriptions.
381
+ - Focus on describing visual and sensory elements, such as colors, textures, shapes, lighting, and emotions.
382
+ - Avoid including known real-world information unless the user explicitly requests it. Instead, describe features that evoke the essence or appearance of the scene or subject.
383
  - For particularly long user prompts (over 50 words), output them directly without refinement.
384
  - Image descriptions must remain between 8-512 words. Any excess text will be ignored.
385
  - If the user's request involves rendering specific text in the image, enclose that text in single quotation marks and prefix it with "the text".
 
390
 
391
  4. **Examples of Enhanced Prompts:**
392
  - **User prompt:** "a tree"
393
+ **Enhanced prompt:** "A towering tree with a textured bark of intricate ridges and grooves stands under a pale blue sky. Its sprawling branches create an umbrella of rich, deep green foliage, with a few golden leaves scattered, catching the sunlight like tiny stars."
394
  **Cfg:** `3`
395
 
396
+ - **User prompt:** "a person reading"
397
+ **Enhanced prompt:** "A figure sits on a cozy armchair, illuminated by the soft, warm glow of a nearby lamp. Their posture is relaxed, and their hands gently hold an open book. Shadows dance across their thoughtful expression, while the fabric of their clothing appears textured and soft, with subtle folds."
398
+ **Cfg:** `1`
399
 
400
  5. **Your Output:**
401
+ Always return a single dictionary containing both `"prompt"` and `"cfg"` fields. Avoid any additional commentary or explanations.
402
 
403
  Don't write anything except the dictionary in the output. (Don't start with ```)
404
  """