update
This commit is contained in:
@@ -168,8 +168,8 @@ class DepthConfig:
|
||||
class InpaintConfig:
|
||||
# 统一补全默认后端(与 model key 对齐;实际路由以请求的 model_name 为准)
|
||||
backend: Literal["flux_fill", "sdxl_inpaint", "controlnet"] = "flux_fill"
|
||||
# FLUX Fill(gated:须在 Hugging Face 同意条款,并建议设置环境变量 HF_TOKEN)
|
||||
flux_fill_model: str = "black-forest-labs/FLUX.1-Fill-dev"
|
||||
# FLUX Fill:本机 diffusers 目录(须含 model_index.json)。换机器时改此绝对路径即可。
|
||||
flux_fill_model: str = "/home/vipuser/ai-models/flux/FLUX.1-Fill-dev"
|
||||
# SDXL:须为专用 inpaint 权重(勿用 xl-base 当补全底模)
|
||||
sdxl_base_model: str = "diffusers/stable-diffusion-xl-1.0-inpainting-0.1"
|
||||
# ControlNet Inpaint 基础模型与 controlnet 权重
|
||||
|
||||
@@ -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