recoilme commited on
Commit
3b1dbe2
·
verified ·
1 Parent(s): 9f25f9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -7,15 +7,22 @@ from diffusers import DiffusionPipeline, AutoencoderKL, UNet2DConditionModel, Fl
7
  from typing import Optional, Union, List, Tuple
8
  from PIL import Image
9
 
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  dtype = torch.float16 if torch.cuda.is_available() else torch.float32
12
  model_repo_id = "AiArtLab/sdxs"
13
 
 
 
 
 
 
 
14
  DEFAULT_REFINE_TEMPLATE = (
15
- "You are a visionary artist with prompt engineer skills for a text-to-image AI. "
16
- "Your mind overflows with poetry and distant horizons, yet your hands compulsively work to transform the user's input into a detailed, objective, and aesthetically optimized visual description. "
17
- "Preserve the original subject and intent, but final description must be exactly three sentences. "
18
- "Output **only** the final revised prompt in **English**, with absolutely no commentary or thinking text.\n"
19
  "User input prompt: {prompt}"
20
  )
21
 
 
7
  from typing import Optional, Union, List, Tuple
8
  from PIL import Image
9
 
10
+
11
  device = "cuda" if torch.cuda.is_available() else "cpu"
12
  dtype = torch.float16 if torch.cuda.is_available() else torch.float32
13
  model_repo_id = "AiArtLab/sdxs"
14
 
15
+ #"You are a visionary artist with prompt engineer skills for a text-to-image AI. "
16
+ #"Your mind overflows with poetry and distant horizons, yet your hands compulsively work to transform the user's input into a detailed, objective, and aesthetically optimized visual description. "
17
+ #"Preserve the original subject and intent, but final description must be exactly three sentences. "
18
+ #"Output **only** the final revised prompt in **English**, with absolutely no commentary or thinking text.\n"
19
+ #"User input prompt: {prompt}"
20
+
21
  DEFAULT_REFINE_TEMPLATE = (
22
+ "You are a skilled text-to-image prompt engineer whose sole function is to transform the user's input into an aesthetically optimized, detailed, and visually descriptive three-sentence output. "
23
+ "**Crucially, if the input is short (e.g., '1girl'), you must elaborate using rich, diverse, and specific visual attributes (style, lighting, focus, setting) instead of clichés.** "
24
+ "If the input is already long and descriptive, you must concisely pack the core subject, style, and essential details into the final three-sentence format without losing crucial information. "
25
+ "Output **only** the final revised prompt in **English**, with absolutely no commentary, thinking text, or surrounding quotes.\n"
26
  "User input prompt: {prompt}"
27
  )
28