nsfwalex commited on
Commit
fb68648
1 Parent(s): 7bd45d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -163,11 +163,25 @@ function uploadImage(prompt, images, event, source, value) {
163
  function onDemoLoad(){
164
  let envInfo = getEnvInfo();
165
  console.log(envInfo);
 
 
 
 
 
 
166
  return;
167
  //return envInfo["__domain"], envInfo["__iframe_domain"]
168
  }
169
  </script>
170
  '''
 
 
 
 
 
 
 
 
171
  def save_image(img):
172
  unique_name = str(uuid.uuid4()) + ".png"
173
  img.save(unique_name)
@@ -213,7 +227,7 @@ def generate(prompt, progress=gr.Progress(track_tqdm=True)):
213
  with gr.Blocks(css=css,head=js,fill_height=True) as demo:
214
  with gr.Row(equal_height=False):
215
  with gr.Group():
216
-
217
  result = gr.Gallery(
218
  label="Result", show_label=False, columns=1, rows=1, show_share_button=True,
219
  show_download_button=True,allow_preview=True,interactive=False, min_width=cfg.get("window_min_width", 340),height=360
 
163
  function onDemoLoad(){
164
  let envInfo = getEnvInfo();
165
  console.log(envInfo);
166
+ if (envInfo["e"] == "1"){
167
+ var element = document.getElementById("desc_html_code");
168
+ if (element) {
169
+ element.parentNode.removeChild(element);
170
+ }
171
+ }
172
  return;
173
  //return envInfo["__domain"], envInfo["__iframe_domain"]
174
  }
175
  </script>
176
  '''
177
+ desc='''
178
+ <div style="background-color: #f0f0f0; padding: 10px; border-radius: 5px; text-align: center; margin-top: 20px;">
179
+ <p style="font-size: 16px; color: #333;">
180
+ For the full version and more exciting NSFW AI apps, visit
181
+ <a href="https://nsfwais.io" style="color: #0066cc; text-decoration: none; font-weight: bold;" rel="dofollow">nsfwais.io</a>!
182
+ </p>
183
+ </div>
184
+ '''
185
  def save_image(img):
186
  unique_name = str(uuid.uuid4()) + ".png"
187
  img.save(unique_name)
 
227
  with gr.Blocks(css=css,head=js,fill_height=True) as demo:
228
  with gr.Row(equal_height=False):
229
  with gr.Group():
230
+ html = gr.HTML(value=html, elem_id='desc_html_code')
231
  result = gr.Gallery(
232
  label="Result", show_label=False, columns=1, rows=1, show_share_button=True,
233
  show_download_button=True,allow_preview=True,interactive=False, min_width=cfg.get("window_min_width", 340),height=360