Files
2026-04-10 20:08:59 +09:00

93 lines
4.4 KiB
Python

"""
Shared configuration for all eval scripts.
Prompts, seeds, model definitions, and experiment configs.
"""
SEEDS = [42, 137, 256, 512, 777, 1024, 1337, 2048, 3141, 9999]
STEPS = 20
CFG = 1.0
GUIDANCE = 3.5
WIDTH = 1024
HEIGHT = 1024
SAMPLER = "euler"
SCHEDULER = "simple"
# CLIP / VAE files
T5_ENCODER = "t5-v1_1-xxl-encoder-Q8_0.gguf"
CLIP_L = "clip_l.safetensors"
VAE = "ae.safetensors"
# GGUF model files
GGUF_MODELS = {
"Q2_K": "flux1-dev-Q2_K.gguf",
"Q3_K_S": "flux1-dev-Q3_K_S.gguf",
"Q4_0": "flux1-dev-Q4_0.gguf",
"Q4_1": "flux1-dev-Q4_1.gguf",
"Q5_0": "flux1-dev-Q5_0.gguf",
"Q5_1": "flux1-dev-Q5_1.gguf",
"Q6_K": "flux1-dev-Q6_K.gguf",
"Q8_0": "flux1-dev-Q8_0.gguf",
}
MODEL_ORDER = ["Q2_K", "Q3_K_S", "Q4_0", "Q4_1", "Q5_0", "Q5_1", "Q6_K", "Q8_0"]
BASELINE = "Q8_0"
PROMPTS = {
"A01": 'A wooden sign that reads "HELLO WORLD" standing in a grassy field',
"A02": 'A neon sign glowing with the word "OPEN" on a dark city street',
"A03": 'A birthday cake with "Happy 30th" written in pink icing',
"A04": 'A chalkboard with the equation "E = mc²" written in white chalk',
"A05": "A laptop screen displaying the code \"print('hello')\" in a dark IDE",
"B01": "A red cube on top of a blue sphere on a white table",
"B02": "Three green apples arranged in a triangle on a wooden plate",
"B03": "Five yellow balloons floating above a birthday table",
"B04": "A cat sitting to the left of a dog, both facing the camera",
"B05": "A row of ten colored pencils arranged in rainbow order",
"C01": "A close-up portrait of an elderly woman with deep wrinkles and silver hair",
"C02": "A young man with freckles laughing in golden hour sunlight",
"C03": "Two people shaking hands in a modern office",
"C04": "A close-up of an eye with visible iris patterns and eyelashes",
"C05": "A group of five friends taking a selfie at sunset on a beach",
"D01": "A misty mountain lake at sunrise with pine trees reflected in still water",
"D02": "A vast desert with sand dunes under a starry night sky",
"D03": "A snowy village with warm lights glowing from cottage windows",
"D04": "A thunderstorm over an open prairie with lightning in the distance",
"D05": "Northern lights over a frozen Scandinavian lake",
"E01": "An oil painting of a cat in the style of Van Gogh's Starry Night",
"E02": "Abstract geometric shapes in primary colors on a white background",
"E03": "A low-poly 3D render of a wolf howling at the moon",
"E04": "A pencil sketch of a human hand holding a rose",
"E05": "A steampunk mechanical owl with brass gears and copper feathers",
}
PROMPT_IDS = sorted(PROMPTS.keys())
CATEGORIES = ["A", "B", "C", "D", "E"]
# Asymmetric experiment configs
ASYMMETRIC_CONFIGS = [
{"name": "asym_Q2K_Q5_1_k3", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 3},
{"name": "asym_Q2K_Q5_1_k5", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 5},
{"name": "asym_Q2K_Q5_1_k7", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 7},
{"name": "asym_Q2K_Q5_1_k10", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 10},
]
# All configs for measurement scripts (uniform + asymmetric)
def get_all_configs(ladder_dir, asym_dir):
configs = []
for tag in MODEL_ORDER:
configs.append({"name": f"uniform_{tag}", "dir": ladder_dir, "file_tag": tag})
for ac in ASYMMETRIC_CONFIGS:
configs.append({"name": ac["name"], "dir": asym_dir, "file_tag": ac["name"]})
return configs
# Speed benchmark configs
BENCHMARK_CONFIGS = [
{"name": "uniform_Q2_K", "type": "uniform", "model": "flux1-dev-Q2_K.gguf"},
{"name": "uniform_Q5_1", "type": "uniform", "model": "flux1-dev-Q5_1.gguf"},
{"name": "dual_Q2K+Q5_1_k3", "type": "dual", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 3},
{"name": "dual_Q2K+Q5_1_k5", "type": "dual", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 5},
{"name": "dual_Q2K+Q5_1_k7", "type": "dual", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 7},
{"name": "dual_Q2K+Q5_1_k10", "type": "dual", "model_a": "flux1-dev-Q2_K.gguf", "model_b": "flux1-dev-Q5_1.gguf", "switch_step": 10},
]