Yaron Koresh commited on
Commit
d6f0290
·
verified ·
1 Parent(s): 1a9ab75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -450,7 +450,7 @@ MAX_SEED = np.iinfo(np.int32).max
450
  # precision data
451
 
452
  seq=256
453
- image_steps=36
454
  img_accu=0
455
 
456
  # ui data
@@ -519,11 +519,11 @@ torch.cuda.empty_cache()
519
 
520
  # functionality
521
 
522
- @spaces.GPU(duration=240)
523
  def upscaler(
524
  input_image: Image.Image,
525
  prompt: str = "Accurate, Highly Detailed, Realistic, Best Quality, Hyper-Realistic, Super-Realistic, Natural, Reasonable, Logical.",
526
- negative_prompt: str = "Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime Quality, Paint Quality, Movie Quality.",
527
  seed: int = random.randint(0, MAX_SEED),
528
  upscale_factor: int = 2,
529
  controlnet_scale: float = 0.6,
@@ -532,7 +532,7 @@ def upscaler(
532
  tile_width: int = 112,
533
  tile_height: int = 144,
534
  denoise_strength: float = 0.35,
535
- num_inference_steps: int = 24,
536
  solver: str = "DDIM",
537
  ) -> Image.Image:
538
 
@@ -1263,7 +1263,7 @@ def translate(txt,to_lang="en",from_lang="auto"):
1263
  log(f'RET translate with translation as {translation}')
1264
  return translation.lower()
1265
 
1266
- @spaces.GPU(duration=180)
1267
  def handle_generation(h,w,d):
1268
 
1269
  log(f'CALL handle_generate')
@@ -1286,7 +1286,7 @@ def handle_generation(h,w,d):
1286
  d = re.sub(r"([ \t]){1,}", " ", d)
1287
  d = re.sub(r"(\. \.)", ".", d)
1288
 
1289
- neg = f"Textual, Text, Unreal, Blurry, Distorted, Exceptional, Irregular, Unusual, Shiny, Smoothed, Polished, Low Quality, Worst Quality, Normal Quality, Anime, Paint, Movies Quality."
1290
  q = "\""
1291
  pos = f'Accurate, Detailed, Realistic.{ "" if d == "" else " " + d }'
1292
 
 
450
  # precision data
451
 
452
  seq=256
453
+ image_steps=4
454
  img_accu=0
455
 
456
  # ui data
 
519
 
520
  # functionality
521
 
522
+ @spaces.GPU(duration=150)
523
  def upscaler(
524
  input_image: Image.Image,
525
  prompt: str = "Accurate, Highly Detailed, Realistic, Best Quality, Hyper-Realistic, Super-Realistic, Natural, Reasonable, Logical.",
526
+ negative_prompt: str = "Unreal, Exceptional, Irregular, Unusual, Blurry, Smoothed, Polished, Worst Quality, Worse Quality, Normal Quality, Painted, Movies Quality.",
527
  seed: int = random.randint(0, MAX_SEED),
528
  upscale_factor: int = 2,
529
  controlnet_scale: float = 0.6,
 
532
  tile_width: int = 112,
533
  tile_height: int = 144,
534
  denoise_strength: float = 0.35,
535
+ num_inference_steps: int = 15,
536
  solver: str = "DDIM",
537
  ) -> Image.Image:
538
 
 
1263
  log(f'RET translate with translation as {translation}')
1264
  return translation.lower()
1265
 
1266
+ @spaces.GPU(duration=80)
1267
  def handle_generation(h,w,d):
1268
 
1269
  log(f'CALL handle_generate')
 
1286
  d = re.sub(r"([ \t]){1,}", " ", d)
1287
  d = re.sub(r"(\. \.)", ".", d)
1288
 
1289
+ neg = f"Textual, Text, Sign, Label, Title, Unreal, Exceptional, Irregular, Unusual, Blurry, Smoothed, Polished, Worst Quality, Worse Quality, Painted, Movies Quality."
1290
  q = "\""
1291
  pos = f'Accurate, Detailed, Realistic.{ "" if d == "" else " " + d }'
1292