import os import sys # Ensure the repository is in the Python path repo_path = os.path.join(os.getcwd(), "stable-diffusion-webui-forge") sys.path.insert(0, repo_path) try: from launch import demo except ImportError: raise ImportError("Could not import 'demo' from launch.py. Please check if the repository exposes a Gradio interface.") port = int(os.environ.get("PORT", 7860)) app.launch(server_name="0.0.0.0", server_port=port)