File size: 2,863 Bytes
37112ef 1bac607 42ae52a 37112ef 7f167fb ce81b3b 1bac607 b586918 21ef285 e3f3bde 21ef285 adc7d13 4ae3643 adc7d13 42ae52a adc7d13 37112ef c637f12 7f167fb 37112ef acde4c3 7f167fb |
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
import os
import sys
import json
import torch
# Setup Repo
# Audios
matcha_tts_path = os.path.join(os.getcwd(), 'tabs', 'audios', 'modules', 'CosyVoice', 'third_party', 'Matcha-TTS')
cosyvoice_path = os.path.join(os.getcwd(), 'tabs', 'audios', 'modules', 'CosyVoice')
sys.path.append(matcha_tts_path)
sys.path.append(cosyvoice_path)
# Pull latest changes for submodules
os.system('git submodule update --init --recursive')
# Setup ENV
os.environ['HF_HOME'] = os.path.join(os.getcwd(), '.cache')
os.makedirs(os.environ['HF_HOME'], exist_ok=True)
# CSS
css = """
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
body {
font-family: 'Poppins', sans-serif !important;
}
.center-content {
text-align: center;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.center-content h1 {
font-weight: 600;
margin-bottom: 1rem;
}
.center-content p {
margin-bottom: 1.5rem;
}
"""
# Config
class Config:
# General
SECRET_KEY = os.environ.get('SECRET_KEY', '12345678')
MODEL_DOWNLOAD_DIR = os.environ.get('HF_HOME', os.environ.get('HF_HUB_CACHE', '.cache'))
os.makedirs(MODEL_DOWNLOAD_DIR, exist_ok=True)
# Images
IMAGES_MODELS = [{"repo_id": "black-forest-labs/FLUX.1-dev", "loader": "flux", "compute_type": torch.bfloat16,}, {"repo_id": "stabilityai/stable-diffusion-xl-base-1.0", "loader": "sdxl", "compute_type": torch.float16,}]
with open('data/loras/sdxl.json') as f:
IMAGES_LORAS_SDXL = json.load(f)
with open('data/loras/flux.json') as f:
IMAGES_LORAS_FLUX = json.load(f)
IMAGES_CONTROLNETS = [
{
"repo_id": "xinsir/controlnet-depth-sdxl-1.0",
"name": "depth_xl",
"layers": ["depth"],
"loader": "sdxl",
"compute_type": torch.float16,
},
{
"repo_id": "xinsir/controlnet-canny-sdxl-1.0",
"name": "canny_xl",
"layers": ["canny"],
"loader": "sdxl",
"compute_type": torch.float16,
},
{
"repo_id": "xinsir/controlnet-openpose-sdxl-1.0",
"name": "openpose_xl",
"layers": ["pose"],
"loader": "sdxl",
"compute_type": torch.float16,
},
{
"repo_id": "xinsir/controlnet-scribble-sdxl-1.0",
"name": "scribble_xl",
"layers": ["scribble"],
"loader": "sdxl",
"compute_type": torch.float16,
},
{
"repo_id": "Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro",
"name": "flux1_union_pro",
"layers": ["canny", "tile", "depth", "blur", "pose", "gray", "low_quality"],
"loader": "flux-multi",
"compute_type": torch.bfloat16,
}
]
# Audios
AUDIOS_MODELS = []
|