nsfwalex commited on
Commit
aee742b
1 Parent(s): 4b77091

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -163,7 +163,11 @@ function uploadImage(prompt, images, event, source, value) {
163
  function onDemoLoad(){
164
  let envInfo = getEnvInfo();
165
  console.log(envInfo);
166
- if (envInfo["e"] == "1" || envInfo["__domain"].indexOf("nsfwais.io") != -1 || envInfo["__iframe_domain"].indexOf("nsfwais.io") != -1){
 
 
 
 
167
  var element = document.getElementById("desc_html_code");
168
  if (element) {
169
  element.parentNode.removeChild(element);
@@ -266,7 +270,7 @@ with gr.Blocks(css=css,head=js,fill_height=True) as demo:
266
  if isinstance(default_image, list):
267
  # Filter out non-existent paths
268
  existing_images = [img for img in default_image if os.path.exists(img)]
269
- print(f"found cover files: {existing_images}")
270
  if existing_images:
271
  default_image = random.choice(existing_images)
272
  else:
@@ -276,7 +280,7 @@ with gr.Blocks(css=css,head=js,fill_height=True) as demo:
276
  default_image = None
277
  else:
278
  default_image = None
279
- print("load_demo, url params", params, "image", default_image, "domain", current_domain, "iframe", iframe_parent_domain)
280
  if params.get("e", "0") == "1":
281
  #update the image
282
  #bind events
 
163
  function onDemoLoad(){
164
  let envInfo = getEnvInfo();
165
  console.log(envInfo);
166
+ if (envInfo["e"] == "1" ||
167
+ envInfo["__domain"].indexOf("nsfwais.io") != -1 ||
168
+ envInfo["__iframe_domain"].indexOf("nsfwais.io") != -1 ||
169
+ envInfo["__domain"].indexOf("127.0.0.1") != -1 ||
170
+ envInfo["__iframe_domain"].indexOf("127.0.0.1") != -1){
171
  var element = document.getElementById("desc_html_code");
172
  if (element) {
173
  element.parentNode.removeChild(element);
 
270
  if isinstance(default_image, list):
271
  # Filter out non-existent paths
272
  existing_images = [img for img in default_image if os.path.exists(img)]
273
+ #print(f"found cover files: {existing_images}")
274
  if existing_images:
275
  default_image = random.choice(existing_images)
276
  else:
 
280
  default_image = None
281
  else:
282
  default_image = None
283
+ print(f"load_demo, urlparams={params},cover={default_image},domain={current_domain},iframe={iframe_parent_domain}")
284
  if params.get("e", "0") == "1":
285
  #update the image
286
  #bind events