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)