diff --git a/model_presets.toml b/model_presets.toml index 6db8687..98e3122 100644 --- a/model_presets.toml +++ b/model_presets.toml @@ -13,21 +13,7 @@ Detailed Prompting Guide: - Settings: Keep CFG between 5.0 and 7.0; higher values can cause color burn. - Sampler: Works well with DPM++ 2M SDE. """ -"Resolution Set" = "anime_xl" +"Resolution Set" = "sdxl" "CFG Scale" = 6.0 "Sampling Steps" = 28 "Sampling Method" = "DPM++ 2M SDE" - -["flux1-dev"] -description = "State-of-the-art general purpose model, takes natural language." -guide = """ -Detailed Prompting Guide: -- Style: Natural Language. Describe the scene as you would to a human. -- Negatives: Generally doesn't require a negative prompt. -- Settings: Works best with higher resolutions (1024+). -- Sampler: Flux Realistic or Euler. -""" -"Resolution Set" = "flux_standard" -"CFG Scale" = 3.5 -"Sampling Steps" = 20 -"Sampling Method" = "Flux Realistic" diff --git a/resolution_presets.toml b/resolution_presets.toml index 59f804a..bdf33cb 100644 --- a/resolution_presets.toml +++ b/resolution_presets.toml @@ -1,15 +1,9 @@ # Resolution Presets # Format: [preset_name] -# width and height are mandatory. +# Values: "WidthxHeight" -[anime_xl] -square = { width = 1024, height = 1024 } -portrait = { width = 832, height = 1216 } -landscape = { width = 1216, height = 832 } -widescreen = { width = 1536, height = 640 } - -[flux_standard] -square = { width = 1024, height = 1024 } -portrait = { width = 896, height = 1152 } -landscape = { width = 1152, height = 896 } -widescreen = { width = 1344, height = 768 } +[sdxl] +widescreen = "1344x768" +landscape = "1152x896" +square = "1024x1024" +portrait = "896x1152" diff --git a/tools/generate_image.py b/tools/generate_image.py index 1464e9b..f7e670b 100644 --- a/tools/generate_image.py +++ b/tools/generate_image.py @@ -75,11 +75,15 @@ async def handle(args: Dict[str, Any]) -> List[Dict[str, Any]]: if res_set_name and res_set_name in res_cfg: res_set = res_cfg[res_set_name] if res_preset_name in res_set: - res_vals = res_set[res_preset_name] - if "Width" in label_map: - payload[label_map["Width"]] = res_vals["width"] - if "Height" in label_map: - payload[label_map["Height"]] = res_vals["height"] + res_val_str = res_set[res_preset_name] + try: + w, h = map(int, res_val_str.split('x')) + if "Width" in label_map: + payload[label_map["Width"]] = w + if "Height" in label_map: + payload[label_map["Height"]] = h + except (ValueError, AttributeError): + raise ToolError(f"Invalid resolution format for preset '{res_preset_name}': {res_val_str}. Expected 'WidthxHeight'.") else: raise ToolError(f"Resolution preset '{res_preset_name}' not found for this model. Available: {', '.join(res_set.keys())}") else: