Spaces:
Runtime error
Runtime error
File size: 2,102 Bytes
5fbd25d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
"""
Static variables for Fooocus API
"""
img_generate_responses = {
"200": {
"description": "PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON",
"content": {
"application/json": {
"example": [{
"base64": "...very long string...",
"seed": "1050625087",
"finish_reason": "SUCCESS",
}]
},
"application/json async": {
"example": {
"job_id": 1,
"job_type": "Text to Image"
}
},
"image/png": {
"example": "PNG bytes, what did you expect?"
},
},
}
}
default_inpaint_engine_version = "v2.6"
default_styles = ["Fooocus V2", "Fooocus Enhance", "Fooocus Sharp"]
default_base_model_name = "juggernautXL_v8Rundiffusion.safetensors"
default_refiner_model_name = "None"
default_refiner_switch = 0.5
default_loras = [[True, "sd_xl_offset_example-lora_1.0.safetensors", 0.1]]
default_cfg_scale = 7.0
default_prompt_negative = ""
default_aspect_ratio = "1152*896"
default_sampler = "dpmpp_2m_sde_gpu"
default_scheduler = "karras"
available_aspect_ratios = [
"704*1408",
"704*1344",
"768*1344",
"768*1280",
"832*1216",
"832*1152",
"896*1152",
"896*1088",
"960*1088",
"960*1024",
"1024*1024",
"1024*960",
"1088*960",
"1088*896",
"1152*896",
"1152*832",
"1216*832",
"1280*768",
"1344*768",
"1344*704",
"1408*704",
"1472*704",
"1536*640",
"1600*640",
"1664*576",
"1728*576",
]
uov_methods = [
"Disabled",
"Vary (Subtle)",
"Vary (Strong)",
"Upscale (1.5x)",
"Upscale (2x)",
"Upscale (Fast 2x)",
"Upscale (Custom)",
]
outpaint_expansions = ["Left", "Right", "Top", "Bottom"]
def get_aspect_ratio_value(label: str) -> str:
"""
Get aspect ratio
Args:
label: str, aspect ratio
Returns:
"""
return label.split(" ")[0].replace("Γ", "*")
|