fastsdcpu / app.py
Umairbdxn's picture
Update app.py
624d037 verified
raw
history blame contribute delete
886 Bytes
import os
# --- STEP 1: SAFETY FILTER HACK START ---
os.environ["SAFETY_CHECKER"] = "False"
os.environ["DISABLE_SAFETY_CHECKER"] = "1"
try:
# Hum Diffusers library ko 'Hack' kar rahe hain taake wo hamesha "Safe" report kare
from diffusers.pipelines.stable_diffusion import safety_checker
def dummy_safety_checker(self, clip_input, images):
return images, [False] * len(images)
safety_checker.StableDiffusionSafetyChecker.forward = dummy_safety_checker
print("NSFW Filter has been disabled successfully!")
except Exception as e:
print(f"Could not disable safety checker: {e}")
# --- STEP 1: SAFETY FILTER HACK END ---
# --- STEP 2: ORIGINAL APP START ---
from frontend.webui.hf_demo import start_demo_text_to_image
print("Starting HF demo text to image")
# Yeh false shayad 'share' setting hai, isko aise hi rehne dein
start_demo_text_to_image(False)