yaron123 commited on
Commit
5abcd39
·
1 Parent(s): d274843
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -621,10 +621,10 @@ def handle_generate(artist,song,genre,lyrics):
621
  pos_song = ' '.join(word[0].upper() + word[1:] for word in pos_song.split())
622
  pos_genre = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", genre)).upper().strip()
623
  pos_lyrics = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", lyrics)).lower().strip()
624
- pos_lyrics_sum = pos_lyrics == "" if pos_lyrics else summarize_text(pos_lyrics)
625
  neg = f"Textual Labeled Distorted Discontinuous Ugly Blurry Low-Quality Worst-Quality Low-Resolution Painted"
626
  q = "\""
627
- pos = f'Realistic Vivid Genuine Reasonable Highly-Detailed 4K { pos_genre } SONG { pos_song } { pos_lyrics_sum == "" if "INSTRUMENTAL" else q+ pos_lyrics_sum +q }'
628
 
629
  print(f"""
630
  Positive: {pos}
@@ -642,7 +642,7 @@ def handle_generate(artist,song,genre,lyrics):
642
  name = f'{pos_artist} - {pos_song} ({index}).png'
643
  enhanced_img.save(name)
644
  names.append(name)
645
- return names
646
 
647
  # entry
648
 
@@ -667,7 +667,7 @@ if __name__ == "__main__":
667
  max_lines=1
668
  )
669
  genre = gr.Textbox(
670
- placeholder="Genre",
671
  value="",
672
  container=False,
673
  max_lines=1
 
621
  pos_song = ' '.join(word[0].upper() + word[1:] for word in pos_song.split())
622
  pos_genre = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", genre)).upper().strip()
623
  pos_lyrics = re.sub(f'[{punctuation}]', '', re.sub("([ \t\n]){1,}", " ", lyrics)).lower().strip()
624
+ pos_lyrics_sum = pos_lyrics if pos_lyrics == "" else summarize_text(pos_lyrics)
625
  neg = f"Textual Labeled Distorted Discontinuous Ugly Blurry Low-Quality Worst-Quality Low-Resolution Painted"
626
  q = "\""
627
+ pos = f'Realistic Vivid Genuine Reasonable Highly-Detailed 4K { pos_genre } SONG { pos_song } { "INSTRUMENTAL" if pos_lyrics_sum == "" else q + pos_lyrics_sum + q }'
628
 
629
  print(f"""
630
  Positive: {pos}
 
642
  name = f'{pos_artist} - {pos_song} ({index}).png'
643
  enhanced_img.save(name)
644
  names.append(name)
645
+ return *names
646
 
647
  # entry
648
 
 
667
  max_lines=1
668
  )
669
  genre = gr.Textbox(
670
+ placeholder="Genre (English)",
671
  value="",
672
  container=False,
673
  max_lines=1