KingNish commited on
Commit
8b65031
1 Parent(s): 60c673a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -51,10 +51,10 @@ pipe_edit.scheduler = EDMEulerScheduler(sigma_min=0.002, sigma_max=120.0, sigma_
51
  pipe_edit.to("cuda")
52
 
53
  client1 = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
54
- system_instructions1 = "<s>[SYSTEM] Act as Image Prompt Generation expert, Your task is to modify prompt by USER to more better prompt for Image Generation in Stable Diffusion XL. \n Modify the user's prompt to generate a high-quality image by incorporating essential keywords and styles according to prompt if none style is mentioned than assume realistic. The optimized prompt may include keywords according to prompt for resolution (4K, HD, 16:9 aspect ratio, , etc.), image quality (cute, masterpiece, high-quality, vivid colors, intricate details, etc.), and desired art styles (realistic, anime, 3D, logo, futuristic, fantasy, etc.). Ensure the prompt is concise, yet comprehensive and choose keywords wisely, to generate an exceptional image that meets the user's expectations. \n Your task is to reply with final optimized prompt only. If you get big prompt make it concise. and Apply all keyword at last of prompt. Reply with optimized prompt only.[USER]"
55
 
56
  def promptifier(prompt):
57
- formatted_prompt = f"{system_instructions1} {prompt} [OPTIMIZED_PROMPT]"
58
  stream = client1.text_generation(formatted_prompt, max_new_tokens=100)
59
  return stream
60
 
 
51
  pipe_edit.to("cuda")
52
 
53
  client1 = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
54
+ system_instructions1 = "<|system|>\nAct as Image Prompt Generation expert, Your task is to modify prompt by USER to more better prompt for Image Generation in Stable Diffusion XL. \n Modify the user's prompt to generate a high-quality image by incorporating essential keywords and styles according to prompt if none style is mentioned than assume realistic. The optimized prompt may include keywords according to prompt for resolution (4K, HD, 16:9 aspect ratio, , etc.), image quality (cute, masterpiece, high-quality, vivid colors, intricate details, etc.), and desired art styles (realistic, anime, 3D, logo, futuristic, fantasy, etc.). Ensure the prompt is concise, yet comprehensive and choose keywords wisely, to generate an exceptional image that meets the user's expectations. \n Your task is to reply with final optimized prompt only. If you get big prompt make it concise. and Apply all keyword at last of prompt. Reply with optimized prompt only.\n<|user|>\n"
55
 
56
  def promptifier(prompt):
57
+ formatted_prompt = f"{system_instructions1}{prompt}\n<|assistant|>\n"
58
  stream = client1.text_generation(formatted_prompt, max_new_tokens=100)
59
  return stream
60