Upload pipeline_input_processor.py
Browse files4 unmodified lines56789101145 unmodified lines57585960616274 unmodified lines137138139140141142225 unmodified lines3683693703713723734 unmodified linesfrom PIL import Image, ImageChopsfrom typing import Dict, Any, Listfrom core.settings import INPUT_DIR, MULTIPLIERS_MAPfrom utils.app_utils import (sanitize_filename,get_lora_path,45 unmodified lineslora_filename = Noneif source == "File":lora_filename = sanitize_filename(lora_id)elif source in ("Civitai", "Hugging Face"):local_path, status = get_lora_path(source, lora_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: lora_filename = os.path.basename(local_path)74 unmodified linesemb_filename = Noneif source == "File":emb_filename = sanitize_filename(emb_id)elif source in ("Civitai", "Hugging Face"):local_path, status = get_embedding_path(source, emb_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: emb_filename = os.path.basename(local_path)225 unmodified linesif vae_source and vae_source != "None":if vae_source == "File":vae_name_override = sanitize_filename(vae_id)elif vae_source in ("Civitai", "Hugging Face") and vae_id and vae_id.strip():local_path, status = get_vae_path(vae_source, vae_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: vae_name_override = os.path.basename(local_path)4 unmodified lines56789101145 unmodified lines57585960616263646574 unmodified lines140141142143144145146147148225 unmodified lines3743753763773783793803813824 unmodified linesfrom PIL import Image, ImageChopsfrom typing import Dict, Any, Listfrom core.settings import INPUT_DIR, MULTIPLIERS_MAP, LORA_DIR, EMBEDDING_DIR, VAE_DIRfrom utils.app_utils import (sanitize_filename,get_lora_path,45 unmodified lineslora_filename = Noneif source == "File":lora_filename = sanitize_filename(lora_id)local_path = os.path.join(LORA_DIR, lora_filename)if not os.path.exists(local_path):raise gr.Error(f"Uploaded LoRA file '{lora_id}' no longer exists on server. Please re-upload it.")elif source in ("Civitai", "Hugging Face"):local_path, status = get_lora_path(source, lora_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: lora_filename = os.path.basename(local_path)74 unmodified linesemb_filename = Noneif source == "File":emb_filename = sanitize_filename(emb_id)local_path = os.path.join(EMBEDDING_DIR, emb_filename)if not os.path.exists(local_path):raise gr.Error(f"Uploaded Embedding file '{emb_id}' no longer exists on server. Please re-upload it.")elif source in ("Civitai", "Hugging Face"):local_path, status = get_embedding_path(source, emb_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: emb_filename = os.path.basename(local_path)225 unmodified linesif vae_source and vae_source != "None":if vae_source == "File":vae_name_override = sanitize_filename(vae_id)local_path = os.path.join(VAE_DIR, vae_name_override)if not os.path.exists(local_path):raise gr.Error(f"Uploaded VAE file '{vae_id}' no longer exists on server. Please re-upload it.")elif vae_source in ("Civitai", "Hugging Face") and vae_id and vae_id.strip():local_path, status = get_vae_path(vae_source, vae_id, os.environ.get("CIVITAI_API_KEY", ""), progress)if local_path: vae_name_override = os.path.basename(local_path)
core/pipelines/pipeline_input_processor.py+10-1