KingNish commited on
Commit
928f3b9
·
verified ·
1 Parent(s): 314fe06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -52,7 +52,7 @@ pipe_edit.scheduler = EDMEulerScheduler(sigma_min=0.002, sigma_max=120.0, sigma_
52
  pipe_edit.to("cuda")
53
 
54
  def promptifier(prompt):
55
- client1 = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
56
  system_instructions1 = "<s>[SYSTEM] Your task is to modify prompt by USER to more better prompt for Image Generation in Stable Diffusion XL, reply with prompt only, Your task is to reply with final prompt in SDXL image generation format only. Just reply with pure prompt.[USER]"
57
  formatted_prompt = f"{system_instructions1} {prompt} [FINAL_PROMPT]"
58
  stream = client1.text_generation(formatted_prompt, max_new_tokens=80, stream=True, details=True, return_full_text=False)
@@ -72,8 +72,7 @@ def king(type ,
72
  height: int = 1024,
73
  guidance_scale: float = 6,
74
  fast=False,
75
- use_resolution_binning: bool = True,
76
- progress=gr.Progress(track_tqdm=True),
77
  ):
78
  if type=="Image Editing" :
79
  raw_image = Image.open(input_image).convert('RGB')
@@ -105,6 +104,7 @@ def king(type ,
105
  guidance_scale = guidance_scale2,
106
  num_inference_steps = steps,
107
  width = width, height = height,
 
108
  generator = generator, output_type="latent",
109
  ).images
110
  else:
@@ -117,6 +117,7 @@ def king(type ,
117
  guidance_scale = guidance_scale,
118
  num_inference_steps = steps,
119
  width = width, height = height,
 
120
  generator = generator, output_type="latent",
121
  ).images
122
 
@@ -190,7 +191,7 @@ examples=[
190
  ],
191
  ]
192
 
193
- with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
194
  gr.Markdown("# Image Generator Pro")
195
  with gr.Row():
196
  instruction = gr.Textbox(lines=1, label="Instruction", interactive=True)
 
52
  pipe_edit.to("cuda")
53
 
54
  def promptifier(prompt):
55
+ client1 = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
56
  system_instructions1 = "<s>[SYSTEM] Your task is to modify prompt by USER to more better prompt for Image Generation in Stable Diffusion XL, reply with prompt only, Your task is to reply with final prompt in SDXL image generation format only. Just reply with pure prompt.[USER]"
57
  formatted_prompt = f"{system_instructions1} {prompt} [FINAL_PROMPT]"
58
  stream = client1.text_generation(formatted_prompt, max_new_tokens=80, stream=True, details=True, return_full_text=False)
 
72
  height: int = 1024,
73
  guidance_scale: float = 6,
74
  fast=False,
75
+ progress=gr.Progress(track_tqdm=True)
 
76
  ):
77
  if type=="Image Editing" :
78
  raw_image = Image.open(input_image).convert('RGB')
 
104
  guidance_scale = guidance_scale2,
105
  num_inference_steps = steps,
106
  width = width, height = height,
107
+ use_resolution_binning = True,
108
  generator = generator, output_type="latent",
109
  ).images
110
  else:
 
117
  guidance_scale = guidance_scale,
118
  num_inference_steps = steps,
119
  width = width, height = height,
120
+ use_resolution_binning = True,
121
  generator = generator, output_type="latent",
122
  ).images
123
 
 
191
  ],
192
  ]
193
 
194
+ with gr.Blocks(css=css) as demo:
195
  gr.Markdown("# Image Generator Pro")
196
  with gr.Row():
197
  instruction = gr.Textbox(lines=1, label="Instruction", interactive=True)