File size: 886 Bytes
624d037
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14a2ee4
 
c0394e2
624d037
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)