# util.py def get_default_hyperparameters(model_name): """ Returns default hyperparameters based on the model name. Args: model_name (str): Name of the selected model. Returns: dict: A dictionary of default hyperparameters. """ # Define default hyperparameters for each model default_hyperparameters = { "black-forest-labs/FLUX.1-schnell": { "guidance_scale": 0, "width": 1024, "height": 1024, "num_inference_steps": 4, "seed": 0 }, "black-forest-labs/FLUX.1-dev": { "guidance_scale": 3.5, "width": 1024, "height": 1024, "num_inference_steps": 28, "seed": 0 }, "strangerzonehf/Flux-Midjourney-Mix2-LoRA": { "guidance_scale": 3.5, "width": 1024, "height": 1024, "num_inference_steps": 28, "seed": 0 }, "stabilityai/stable-diffusion-3.5-large": { "guidance_scale": 4.5, "width": 1024, "height": 1024, "num_inference_steps": 35, "seed": 0 }, "stabilityai/stable-diffusion-xl-base-1.0": { "guidance_scale": 7, "width": 1024, "height": 1024, "num_inference_steps": 30, "seed": 0 }, "stable-diffusion-v1-5/stable-diffusion-v1-5": { "guidance_scale": 5.0, "width": 512, "height": 512, "num_inference_steps": 20, "seed": 0 } } # Return the hyperparameters for the selected model or a default set if not found return default_hyperparameters.get(model_name, { "guidance_scale": 7.5, "width": 512, "height": 512, "num_inference_steps": 20, "seed": 42 })