Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -39,12 +39,11 @@ for p in (MODELS, LORA, UPSCALE): p.mkdir(parents=True, exist_ok=True)
|
|
39 |
# 3. モデル ID / ファイル
|
40 |
##############################################################################
|
41 |
# --- BRA v7 (公開) ---
|
42 |
-
BRA_REPO = "AIGaming/beautiful_realistic_asians"
|
43 |
BRA_FILE = "beautifulRealistic_v7.safetensors"
|
44 |
BRA_REV = "801a9b1999dd7018e58a1e2b432fdccd3d1d723d" # 固定 revision
|
45 |
|
46 |
# --- IP-Adapter 本体 & LoRA ---
|
47 |
-
### 修正 ### 重みファイルへのフルパスを指定し、サブフォルダ定義を削除
|
48 |
IP_REPO, IP_BIN = "h94/IP-Adapter", "models/ip-adapter-plus-face_sd15.bin"
|
49 |
LORA_REPO,IP_LORA = "h94/IP-Adapter-FaceID", "ip-adapter-faceid-plusv2_sd15_lora.safetensors"
|
50 |
|
@@ -94,10 +93,11 @@ def init():
|
|
94 |
pipe_.scheduler = DPMSolverMultistepScheduler.from_config(pipe_.scheduler.config)
|
95 |
|
96 |
# 6-4 IP-Adapter
|
97 |
-
### 修正 ### load_ip_adapter がダウンロードを処理するため、個別のdlは不要。
|
98 |
-
### また、呼び出し方を修正し、リポジトリIDと重みのフルパスを渡す。
|
99 |
ip_lora = dl(LORA_REPO, IP_LORA)
|
100 |
-
|
|
|
|
|
|
|
101 |
AttnProcsLayers(pipe_.unet.attn_processors).load_lora_weights(
|
102 |
ip_lora, adapter_name="ip_faceid", safe_load=True
|
103 |
)
|
|
|
39 |
# 3. モデル ID / ファイル
|
40 |
##############################################################################
|
41 |
# --- BRA v7 (公開) ---
|
42 |
+
BRA_REPO = "AIGaming/beautiful_realistic_asians"
|
43 |
BRA_FILE = "beautifulRealistic_v7.safetensors"
|
44 |
BRA_REV = "801a9b1999dd7018e58a1e2b432fdccd3d1d723d" # 固定 revision
|
45 |
|
46 |
# --- IP-Adapter 本体 & LoRA ---
|
|
|
47 |
IP_REPO, IP_BIN = "h94/IP-Adapter", "models/ip-adapter-plus-face_sd15.bin"
|
48 |
LORA_REPO,IP_LORA = "h94/IP-Adapter-FaceID", "ip-adapter-faceid-plusv2_sd15_lora.safetensors"
|
49 |
|
|
|
93 |
pipe_.scheduler = DPMSolverMultistepScheduler.from_config(pipe_.scheduler.config)
|
94 |
|
95 |
# 6-4 IP-Adapter
|
|
|
|
|
96 |
ip_lora = dl(LORA_REPO, IP_LORA)
|
97 |
+
|
98 |
+
### 最終修正 ### subfolder引数に空文字列""を渡し、TypeErrorを回避する
|
99 |
+
pipe_.load_ip_adapter(IP_REPO, "", weight_name=IP_BIN, cache_dir=str(MODELS))
|
100 |
+
|
101 |
AttnProcsLayers(pipe_.unet.attn_processors).load_lora_weights(
|
102 |
ip_lora, adapter_name="ip_faceid", safe_load=True
|
103 |
)
|