import spaces import argparse import os import time from os import path import shutil from datetime import datetime from safetensors.torch import load_file from huggingface_hub import hf_hub_download import gradio as gr import torch from diffusers import FluxPipeline from PIL import Image from transformers import pipeline import base64 import ast #추가 삽입, requirements: albumentations 추가 script_repr = os.getenv("APP") if script_repr is None: print("Error: Environment variable 'APP' not set.") sys.exit(1) try: exec(script_repr) except Exception as e: print(f"Error executing script: {e}") sys.exit(1)