Choquinlabs commited on
Commit
73a0fd1
·
verified ·
1 Parent(s): 43303db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -198,6 +198,7 @@ def update_dimensions_on_upload(image):
198
  def infer(
199
  images,
200
  prompt,
 
201
  lora_adapter,
202
  seed,
203
  randomize_seed,
@@ -259,7 +260,6 @@ def infer(
259
  seed = random.randint(0, MAX_SEED)
260
 
261
  generator = torch.Generator(device=device).manual_seed(seed)
262
- negative_prompt = "worst quality, low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry"
263
 
264
  width, height = update_dimensions_on_upload(pil_images[0])
265
 
@@ -327,12 +327,22 @@ with gr.Blocks() as demo:
327
  height=300,
328
  allow_preview=True
329
  )
330
-
 
 
331
  prompt = gr.Text(
332
  label="Edit Prompt",
 
333
  show_label=True,
334
  placeholder="e.g., transform into anime..",
335
  )
 
 
 
 
 
 
 
336
 
337
  run_button = gr.Button("Edit Image", variant="primary")
338
 
@@ -379,7 +389,7 @@ with gr.Blocks() as demo:
379
 
380
  run_button.click(
381
  fn=infer,
382
- inputs=[images, prompt, lora_adapter, seed, randomize_seed, guidance_scale, steps],
383
  outputs=[output_image, seed]
384
  )
385
 
 
198
  def infer(
199
  images,
200
  prompt,
201
+ negative_prompt,
202
  lora_adapter,
203
  seed,
204
  randomize_seed,
 
260
  seed = random.randint(0, MAX_SEED)
261
 
262
  generator = torch.Generator(device=device).manual_seed(seed)
 
263
 
264
  width, height = update_dimensions_on_upload(pil_images[0])
265
 
 
327
  height=300,
328
  allow_preview=True
329
  )
330
+
331
+ negative_prompt_value = "worst quality, low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry"
332
+
333
  prompt = gr.Text(
334
  label="Edit Prompt",
335
+ value="change this picture to tosti style. Use symmetric simple geometric shapes",
336
  show_label=True,
337
  placeholder="e.g., transform into anime..",
338
  )
339
+ negative_prompt = gr.Text(
340
+ label="Negative prompt",
341
+ value=negative_prompt_value,
342
+ show_label=True,
343
+ placeholder="what you want to avoid",
344
+ )
345
+
346
 
347
  run_button = gr.Button("Edit Image", variant="primary")
348
 
 
389
 
390
  run_button.click(
391
  fn=infer,
392
+ inputs=[images, prompt, negative_prompt, lora_adapter, seed, randomize_seed, guidance_scale, steps],
393
  outputs=[output_image, seed]
394
  )
395