update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable
|
||||
|
||||
import numpy as np
|
||||
@@ -24,12 +24,15 @@ def make_flux_fill_predictor(
|
||||
else:
|
||||
torch_dtype = torch.float32
|
||||
|
||||
hf_token = os.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN")
|
||||
root = Path(model_id.strip()).expanduser()
|
||||
# 本机 diffusers 目录(含 model_index.json)时不访问 Hub,避免自动下载。
|
||||
local_files_only = root.is_dir() and (root / "model_index.json").is_file()
|
||||
|
||||
pipe = FluxFillPipeline.from_pretrained(
|
||||
model_id,
|
||||
str(root),
|
||||
torch_dtype=torch_dtype,
|
||||
token=hf_token,
|
||||
token=None,
|
||||
local_files_only=local_files_only,
|
||||
)
|
||||
|
||||
if device == "cuda":
|
||||
|
||||
Reference in New Issue
Block a user