Commit ·
bde7aa3
1
Parent(s): 673064b
feat: Add authentication token support for Flux and CatVTON pipelines in app.py
Browse files- Integrated the use of an authentication token for accessing Hugging Face models in the FluxTryOnPipeline and CatVTONPix2PixPipeline.
- Updated the model loading functions to include `use_auth_token` parameter, enhancing security and access control for model repositories.
136 unmodified lines1371381391401411421431443 unmodified lines148149150151152153154136 unmodified lines# Flux-based CatVTONflux_repo = "black-forest-labs/FLUX.1-Fill-dev"pipeline_flux = FluxTryOnPipeline.from_pretrained(flux_repo)pipeline_flux.load_lora_weights(os.path.join(repo_path, "flux-lora"),weight_name='pytorch_lora_weights.safetensors'3 unmodified lines# Mask-free CatVTONcatvton_mf_repo = "zhengchong/CatVTON-MaskFree"repo_path_mf = snapshot_download(repo_id=catvton_mf_repo)pipeline_p2p = CatVTONPix2PixPipeline(base_ckpt=args.p2p_base_model_path,attn_ckpt=repo_path_mf,136 unmodified lines1371381391401411421431441453 unmodified lines149150151152153154155136 unmodified lines# Flux-based CatVTONaccess_token = os.getenv("HUGGING_FACE_HUB_TOKEN")flux_repo = "black-forest-labs/FLUX.1-Fill-dev"pipeline_flux = FluxTryOnPipeline.from_pretrained(flux_repo, use_auth_token=access_token)pipeline_flux.load_lora_weights(os.path.join(repo_path, "flux-lora"),weight_name='pytorch_lora_weights.safetensors'3 unmodified lines# Mask-free CatVTONcatvton_mf_repo = "zhengchong/CatVTON-MaskFree"repo_path_mf = snapshot_download(repo_id=catvton_mf_repo, use_auth_token=access_token)pipeline_p2p = CatVTONPix2PixPipeline(base_ckpt=args.p2p_base_model_path,attn_ckpt=repo_path_mf,
app.py+3-2