DGSpitzer commited on
Commit
cd5a5f1
1 Parent(s): 2dbde8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,7 +76,7 @@ def get_result(text_prompts, style_indx):
76
  prompt = style + "," + text_prompts
77
 
78
 
79
- image_output = pipe(prompt).images[0]
80
 
81
  print("Generated image with prompt " + prompt)
82
 
@@ -96,7 +96,7 @@ def get_result(text_prompts, style_indx):
96
  return {spec_result:spec_image, video_result:video_merged, status_text:'Success'}
97
 
98
  def get_music(prompt):
99
- spec = pipe(prompt).images[0]
100
  print(spec)
101
  wav = wav_bytes_from_spectrogram_image(spec)
102
  with open("output.wav", "wb") as f:
 
76
  prompt = style + "," + text_prompts
77
 
78
 
79
+ image_output = pipe(prompt).images[0] if not results.nsfw_content_detected[0] else Image.open("nsfw_placeholder.jpg")
80
 
81
  print("Generated image with prompt " + prompt)
82
 
 
96
  return {spec_result:spec_image, video_result:video_merged, status_text:'Success'}
97
 
98
  def get_music(prompt):
99
+ spec = pipe2(prompt).images[0]
100
  print(spec)
101
  wav = wav_bytes_from_spectrogram_image(spec)
102
  with open("output.wav", "wb") as f: