mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 10:41:25 +00:00
better diffusers handling
This commit is contained in:
@@ -33,17 +33,9 @@ class PreprocessorMarigold(Preprocessor):
|
|||||||
if self.model_patcher is not None:
|
if self.model_patcher is not None:
|
||||||
return
|
return
|
||||||
|
|
||||||
checkpoint_path = os.path.join(preprocessor_dir, 'marigold')
|
|
||||||
|
|
||||||
if not os.path.exists(checkpoint_path):
|
|
||||||
snapshot_download(repo_id="Bingxin/Marigold",
|
|
||||||
ignore_patterns=["*.bin"],
|
|
||||||
local_dir=checkpoint_path,
|
|
||||||
local_dir_use_symlinks=False)
|
|
||||||
|
|
||||||
self.diffusers_patcher = DiffusersModelPatcher(
|
self.diffusers_patcher = DiffusersModelPatcher(
|
||||||
pipeline_class=MarigoldPipeline,
|
pipeline_class=MarigoldPipeline,
|
||||||
pretrained_path=checkpoint_path,
|
pretrained_path="Bingxin/Marigold",
|
||||||
enable_xformers=False,
|
enable_xformers=False,
|
||||||
noise_scheduler_type='DDIMScheduler')
|
noise_scheduler_type='DDIMScheduler')
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
@@ -49,4 +50,24 @@ def initialize_forge():
|
|||||||
|
|
||||||
import modules_forge.patch_basic
|
import modules_forge.patch_basic
|
||||||
modules_forge.patch_basic.patch_all_basics()
|
modules_forge.patch_basic.patch_all_basics()
|
||||||
|
|
||||||
|
from modules_forge.shared import diffusers_dir
|
||||||
|
|
||||||
|
if 'TRANSFORMERS_CACHE' not in os.environ:
|
||||||
|
os.environ['TRANSFORMERS_CACHE'] = diffusers_dir
|
||||||
|
|
||||||
|
if 'HF_HOME' not in os.environ:
|
||||||
|
os.environ['HF_HOME'] = diffusers_dir
|
||||||
|
|
||||||
|
if 'HF_DATASETS_CACHE' not in os.environ:
|
||||||
|
os.environ['HF_DATASETS_CACHE'] = diffusers_dir
|
||||||
|
|
||||||
|
if 'HUGGINGFACE_HUB_CACHE' not in os.environ:
|
||||||
|
os.environ['HUGGINGFACE_HUB_CACHE'] = diffusers_dir
|
||||||
|
|
||||||
|
if 'HUGGINGFACE_ASSETS_CACHE' not in os.environ:
|
||||||
|
os.environ['HUGGINGFACE_ASSETS_CACHE'] = diffusers_dir
|
||||||
|
|
||||||
|
if 'HF_HUB_CACHE' not in os.environ:
|
||||||
|
os.environ['HF_HUB_CACHE'] = diffusers_dir
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ os.makedirs(controlnet_dir, exist_ok=True)
|
|||||||
preprocessor_dir = os.path.join(models_path, 'ControlNetPreprocessor')
|
preprocessor_dir = os.path.join(models_path, 'ControlNetPreprocessor')
|
||||||
os.makedirs(preprocessor_dir, exist_ok=True)
|
os.makedirs(preprocessor_dir, exist_ok=True)
|
||||||
|
|
||||||
|
diffusers_dir = os.path.join(models_path, 'diffusers')
|
||||||
|
os.makedirs(diffusers_dir, exist_ok=True)
|
||||||
|
|
||||||
supported_preprocessors = {}
|
supported_preprocessors = {}
|
||||||
supported_control_models = []
|
supported_control_models = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user