yaron123 commited on
Commit
d4b23f6
·
1 Parent(s): f8c89bf
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -509,8 +509,8 @@ pegasus_model = PegasusForConditionalGeneration.from_pretrained("google/pegasus-
509
 
510
  def upscaler(
511
  input_image: Image.Image,
512
- prompt: str = "Best-Quality Realistic Genuine Reasonable Highly-Detailed",
513
- negative_prompt: str = "Distorted Discontinuous Ugly Blurry Low-Quality Worst-Quality Normal-Quality Low-Resolution Painted",
514
  seed: int = int(str(random.random()).split(".")[1]),
515
  upscale_factor: int = 4,
516
  controlnet_scale: float = 0.6,
@@ -584,7 +584,7 @@ def pipe_generate_image(p1,p2):
584
 
585
  def add_song_cover_text(img,artist,song,height,width):
586
 
587
- draw = ImageDraw.Draw(img)
588
 
589
  rows = 1
590
  labels_distance = 1/3
@@ -607,7 +607,7 @@ def add_song_cover_text(img,artist,song,height,width):
607
 
608
  return img
609
 
610
- @spaces.GPU(duration=300)
611
  def all_pipes(pos,neg,artist,song):
612
  imgs = pipe_generate_image(pos,neg)
613
 
@@ -631,9 +631,9 @@ def handle_generate(artist,song,genre,lyrics):
631
  pos_genre = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", genre)).upper().strip()
632
  pos_lyrics = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", lyrics)).lower().strip()
633
  pos_lyrics_sum = pos_lyrics if pos_lyrics == "" else summarize_text(pos_lyrics)
634
- neg = f"Textual Labeled Distorted Discontinuous Ugly Blurry Low-Quality Worst-Quality Low-Resolution Painted Smoothed"
635
  q = "\""
636
- pos = f'Rough Realistic Natural Genuine Reasonable Highly-Detailed { pos_genre } MUSIC GENRE { pos_song }{ pos_lyrics_sum if pos_lyrics_sum == "" else " " + q + pos_lyrics_sum + q }'
637
 
638
  print(f"""
639
  Positive: {pos}
 
509
 
510
  def upscaler(
511
  input_image: Image.Image,
512
+ prompt: str = "Photorealistic, Hyperrealistic, Realistic Photography, High-Quality Photography, Natural.",
513
+ negative_prompt: str = "Distorted, Discontinuous, Blurry, Doll-Like, Overly-Plastic, Low-Quality, Painted, Smoothed, Artificial, Phony, Gaudy, Digital Effects.",
514
  seed: int = int(str(random.random()).split(".")[1]),
515
  upscale_factor: int = 4,
516
  controlnet_scale: float = 0.6,
 
584
 
585
  def add_song_cover_text(img,artist,song,height,width):
586
 
587
+ draw = ImageDraw.Draw(img,mode="RGBA")
588
 
589
  rows = 1
590
  labels_distance = 1/3
 
607
 
608
  return img
609
 
610
+ @spaces.GPU(duration=180)
611
  def all_pipes(pos,neg,artist,song):
612
  imgs = pipe_generate_image(pos,neg)
613
 
 
631
  pos_genre = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", genre)).upper().strip()
632
  pos_lyrics = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", lyrics)).lower().strip()
633
  pos_lyrics_sum = pos_lyrics if pos_lyrics == "" else summarize_text(pos_lyrics)
634
+ neg = f"Sexual, Textual, Labeled, Distorted, Discontinuous, Blurry, Doll-Like, Overly-Plastic, Low-Quality, Painted, Smoothed, Artificial, Phony, Gaudy, Digital Effects."
635
  q = "\""
636
+ pos = f'Photorealistic, Hyperrealistic, Realistic Photography, High-Quality Photography, Natural, made for the { pos_genre } SONG "{ pos_song }"{ pos_lyrics_sum if pos_lyrics_sum == "" else ": " + q + pos_lyrics_sum + q }.'
637
 
638
  print(f"""
639
  Positive: {pos}