包含: - 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 排除, 由网盘单独上传。
34 lines
934 B
Python
Executable File
34 lines
934 B
Python
Executable File
import pytest
|
|
import requests
|
|
|
|
|
|
def test_options_write(base_url):
|
|
url_options = f"{base_url}/sdapi/v1/options"
|
|
response = requests.get(url_options)
|
|
assert response.status_code == 200
|
|
|
|
pre_value = response.json()["send_seed"]
|
|
|
|
assert requests.post(url_options, json={'send_seed': (not pre_value)}).status_code == 200
|
|
|
|
response = requests.get(url_options)
|
|
assert response.status_code == 200
|
|
assert response.json()['send_seed'] == (not pre_value)
|
|
|
|
requests.post(url_options, json={"send_seed": pre_value})
|
|
|
|
|
|
@pytest.mark.parametrize("url", [
|
|
"sdapi/v1/cmd-flags",
|
|
"sdapi/v1/samplers",
|
|
"sdapi/v1/upscalers",
|
|
"sdapi/v1/sd-models",
|
|
"sdapi/v1/hypernetworks",
|
|
"sdapi/v1/face-restorers",
|
|
"sdapi/v1/realesrgan-models",
|
|
"sdapi/v1/prompt-styles",
|
|
"sdapi/v1/embeddings",
|
|
])
|
|
def test_get_api_url(base_url, url):
|
|
assert requests.get(f"{base_url}/{url}").status_code == 200
|