* add new testing method * add testing readme * style: make linter happy * update * update * chore: do some cleanings * update * update * update * update * style: make linter happy * update * finished the first test * update * debugging * update * update * update * update * update * style: make the linter happy * update * finished a case * style: make linter happy * new to figure out how to run mulitiple tests * make linter happy * update * update * add nunchaku-flux.1-depth-lora * rename images to inputs * update * update a dedicated folder for the test workflows * update * update * fix the test scores * style: make linter happy * update upscaler * style: make linter happy * add pulid * add lora * make linter happy * update * update * finished flux fill * style: make linter happy * finished removal * style: make linter happy * add kontext * add kontext turbo * style: make linter happy * add flux.1-schnell tests * finished redux * add qwen-image tests * update * update * style: make linter happy * update * add test results for 5090 * update * update
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
import os
|
|
from pathlib import Path
|
|
|
|
import requests
|
|
import yaml
|
|
from tqdm import tqdm
|
|
|
|
|
|
def main():
|
|
with open(Path(__file__).resolve().parent.parent / "test_data" / "inputs.yaml", "r") as f:
|
|
config = yaml.safe_load(f)
|
|
for group in config.get("inputs", []):
|
|
base_url = group["base_url"]
|
|
download_dir = group.get("download_dir", "input")
|
|
for filename in tqdm(group["files"], desc="Downloading"):
|
|
output_path = os.path.join(download_dir, filename)
|
|
if os.path.exists(output_path):
|
|
print(f"File {filename} already exists, skipping download.")
|
|
continue
|
|
print(f"Downloading {filename}...")
|
|
full_url = base_url.format(filename=filename)
|
|
|
|
# Download with requests - more reliable than wget
|
|
response = requests.get(full_url, stream=True, timeout=30)
|
|
response.raise_for_status()
|
|
|
|
os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)
|
|
with open(output_path, "wb") as f:
|
|
for chunk in response.iter_content(chunk_size=8192):
|
|
f.write(chunk)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|