Update app.py
Browse files
app.py
CHANGED
@@ -132,8 +132,8 @@ function getEnvInfo() {
|
|
132 |
function isValidEnv(){
|
133 |
envInfo = getEnvInfo();
|
134 |
return envInfo["e"] == "1" ||
|
135 |
-
envInfo["__domain"].indexOf("
|
136 |
-
envInfo["__iframe_domain"].indexOf("
|
137 |
envInfo["__domain"].indexOf("127.0.0.1") != -1 ||
|
138 |
envInfo["__iframe_domain"].indexOf("127.0.0.1") != -1;
|
139 |
}
|
@@ -236,7 +236,7 @@ desc_html='''
|
|
236 |
<div style="background-color: #f0f0f0; padding: 10px; border-radius: 5px; text-align: center; margin-top: 20px;">
|
237 |
<p style="font-size: 16px; color: #333;">
|
238 |
For the full version and more exciting NSFW AI apps, visit
|
239 |
-
<a href="https://
|
240 |
</p>
|
241 |
</div>
|
242 |
'''
|
@@ -352,7 +352,7 @@ with gr.Blocks(css=css,head=js,fill_height=True) as demo:
|
|
352 |
"refer": referer,
|
353 |
"host": current_domain
|
354 |
}
|
355 |
-
if params.get("e", "0") == "1" or "
|
356 |
#update the image
|
357 |
#bind events
|
358 |
#return [Image.open(default_image)], session_data
|
|
|
132 |
function isValidEnv(){
|
133 |
envInfo = getEnvInfo();
|
134 |
return envInfo["e"] == "1" ||
|
135 |
+
envInfo["__domain"].indexOf("nsfwaifans.com") != -1 ||
|
136 |
+
envInfo["__iframe_domain"].indexOf("nsfwaifans.com") != -1 ||
|
137 |
envInfo["__domain"].indexOf("127.0.0.1") != -1 ||
|
138 |
envInfo["__iframe_domain"].indexOf("127.0.0.1") != -1;
|
139 |
}
|
|
|
236 |
<div style="background-color: #f0f0f0; padding: 10px; border-radius: 5px; text-align: center; margin-top: 20px;">
|
237 |
<p style="font-size: 16px; color: #333;">
|
238 |
For the full version and more exciting NSFW AI apps, visit
|
239 |
+
<a href="https://nsfwaifans.com?utm_source=hf_'''+cfg["model_id"].replace("/","_")+'''&utm_medium=referral" style="color: #0066cc; text-decoration: none; font-weight: bold;" rel="dofollow">nsfwaifans.com</a>!
|
240 |
</p>
|
241 |
</div>
|
242 |
'''
|
|
|
352 |
"refer": referer,
|
353 |
"host": current_domain
|
354 |
}
|
355 |
+
if params.get("e", "0") == "1" or "nsfwaifans.com" in current_domain or "nsfwaifans.com" in iframe_parent_domain or "127.0.0.1" in current_domain or "127.0.0.1" in iframe_parent_domain:
|
356 |
#update the image
|
357 |
#bind events
|
358 |
#return [Image.open(default_image)], session_data
|