Update app.py
Browse files4 unmodified lines5678910111213141516171819204 unmodified linesimport torchimport gradio as grfrom PIL import Imagefrom huggingface_hub import hf_hub_downloadimport spaceshf_hub_download(repo_id="black-forest-labs/FLUX.1-Redux-dev", filename="flux1-redux-dev.safetensors", local_dir="models/style_models")hf_hub_download(repo_id="black-forest-labs/FLUX.1-Depth-dev", filename="flux1-depth-dev.safetensors", local_dir="models/diffusion_models")hf_hub_download(repo_id="Comfy-Org/sigclip_vision_384", filename="sigclip_vision_patch14_384.safetensors", local_dir="models/clip_vision")hf_hub_download(repo_id="Kijai/DepthAnythingV2-safetensors", filename="depth_anything_v2_vitl_fp32.safetensors", local_dir="models/depthanything")hf_hub_download(repo_id="black-forest-labs/FLUX.1-dev", filename="ae.safetensors", local_dir="models/vae/FLUX1")hf_hub_download(repo_id="comfyanonymous/flux_text_encoders", filename="clip_l.safetensors", local_dir="models/text_encoders")t5_path = hf_hub_download(repo_id="comfyanonymous/flux_text_encoders", filename="t5xxl_fp16.safetensors", local_dir="models/text_encoders/t5")# Import all the necessary functions from the original scriptdef get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:4 unmodified lines56789101112131415161718192021222324252627282930313233343536373839404 unmodified linesimport torchimport gradio as grfrom PIL import Imagefrom huggingface_hub import hf_hub_download, loginimport spaces# Hugging Face ํ ํฐ์ผ๋ก ๋ก๊ทธ์ธHF_TOKEN = os.getenv("HF_TOKEN")if HF_TOKEN is None:raise ValueError("Please set the HF_TOKEN environment variable")login(token=HF_TOKEN)# ์ดํ ๋ชจ๋ธ ๋ค์ด๋ก๋hf_hub_download(repo_id="black-forest-labs/FLUX.1-Redux-dev",filename="flux1-redux-dev.safetensors",local_dir="models/style_models",token=HF_TOKEN # ํ ํฐ ์ ๋ฌ)hf_hub_download(repo_id="black-forest-labs/FLUX.1-Depth-dev",filename="flux1-depth-dev.safetensors",local_dir="models/diffusion_models",token=HF_TOKEN)# ๋๋จธ์ง hf_hub_download ํธ์ถ์๋ token=HF_TOKEN ์ถ๊ฐhf_hub_download(repo_id="Comfy-Org/sigclip_vision_384", filename="sigclip_vision_patch14_384.safetensors", local_dir="models/clip_vision", token=HF_TOKEN)hf_hub_download(repo_id="Kijai/DepthAnythingV2-safetensors", filename="depth_anything_v2_vitl_fp32.safetensors", local_dir="models/depthanything", token=HF_TOKEN)hf_hub_download(repo_id="black-forest-labs/FLUX.1-dev", filename="ae.safetensors", local_dir="models/vae/FLUX1", token=HF_TOKEN)hf_hub_download(repo_id="comfyanonymous/flux_text_encoders", filename="clip_l.safetensors", local_dir="models/text_encoders", token=HF_TOKEN)t5_path = hf_hub_download(repo_id="comfyanonymous/flux_text_encoders", filename="t5xxl_fp16.safetensors", local_dir="models/text_encoders/t5", token=HF_TOKEN)# Import all the necessary functions from the original scriptdef get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
app.py+28-8