File size: 701 Bytes
6230dda
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import diffusers.schedulers
import os
from pathlib import Path

assets_directory = Path(__file__).parent / "ui_assets"

is_hfspace = "SPACE_REPO_NAME" in os.environ

scheduler_dict = {
    k: v
    for k, v in diffusers.schedulers.__dict__.items()
    if "Scheduler" in k and "Flax" not in k
}
scheduler_dict.pop(
    "VQDiffusionScheduler", None
)  # requires unique parameter, unlike other schedulers
scheduler_names = list(scheduler_dict.keys())
default_scheduler = "UniPCMultistepScheduler"

with open(assets_directory / "model_ids.txt", "r") as fp:
    model_ids = fp.read().splitlines()

with open(assets_directory / "controlnet_ids.txt", "r") as fp:
    controlnet_ids = fp.read().splitlines()