包含: - hair_service_sd: 换发型/换发色算法服务 (端口 8801) - photo_service: LoRA 训练调度服务 (端口 32678) - stable-diffusion-webui: SD WebUI 推理服务 (端口 57860) - kohya_ss_home: 训练环境代码 - meidaojia: 监控测试脚本 - setup.sh: 一键部署脚本 (conda环境恢复 + 配置生成 + 完整性检查) - start_all_services.sh: 启动3个服务 - configure.ini.template: 路径模板化 (BASE_DIR自动推导) - conda_envs/py310.yml: py310 环境定义 大文件 (weights/, models/, data/, conda_envs/*.tar.gz 等) 通过 .gitignore 排除, 由网盘单独上传。
47 lines
1.0 KiB
Python
Executable File
47 lines
1.0 KiB
Python
Executable File
from modules import shared
|
|
from packaging import version
|
|
import re
|
|
|
|
|
|
v160 = version.parse("1.6.0")
|
|
v170_tsnr = version.parse("v1.7.0-225")
|
|
v180 = version.parse("1.8.0")
|
|
v180_hr_styles = version.parse("1.8.0-139")
|
|
|
|
|
|
def parse_version(text):
|
|
if text is None:
|
|
return None
|
|
|
|
m = re.match(r'([^-]+-[^-]+)-.*', text)
|
|
if m:
|
|
text = m.group(1)
|
|
|
|
try:
|
|
return version.parse(text)
|
|
except Exception:
|
|
return None
|
|
|
|
|
|
def backcompat(d):
|
|
"""Checks infotext Version field, and enables backwards compatibility options according to it."""
|
|
|
|
if not shared.opts.auto_backcompat:
|
|
return
|
|
|
|
ver = parse_version(d.get("Version"))
|
|
if ver is None:
|
|
return
|
|
|
|
if ver < v160 and '[' in d.get('Prompt', ''):
|
|
d["Old prompt editing timelines"] = True
|
|
|
|
if ver < v160 and d.get('Sampler', '') in ('DDIM', 'PLMS'):
|
|
d["Pad conds v0"] = True
|
|
|
|
if ver < v170_tsnr:
|
|
d["Downcast alphas_cumprod"] = True
|
|
|
|
if ver < v180 and d.get('Refiner'):
|
|
d["Refiner switch by sampling steps"] = True
|