Spaces:
Running
Running
| """ | |
| NAIA-WEB Constants and Configuration | |
| """ | |
| # Resolution presets (width x height) | |
| DEFAULT_RESOLUTIONS = [ | |
| "1024 x 1024", # Square | |
| "960 x 1088", # Slight portrait | |
| "896 x 1152", # Portrait | |
| "832 x 1216", # Tall portrait (default) | |
| "1088 x 960", # Slight landscape | |
| "1152 x 896", # Landscape | |
| "1216 x 832", # Wide landscape | |
| ] | |
| # Model choices (display name) | |
| MODEL_CHOICES = ["NAID4.5F", "NAID4.5C"] | |
| # Model ID mapping (display name -> NAI API model ID) | |
| MODEL_ID_MAP = { | |
| "NAID4.5F": "nai-diffusion-4-5-full", | |
| "NAID4.5C": "nai-diffusion-4-5-curated", | |
| } | |
| # Sampler choices | |
| SAMPLER_CHOICES = [ | |
| "k_euler", | |
| "k_euler_ancestral", | |
| "k_dpmpp_2s_ancestral", | |
| "k_dpmpp_2m", | |
| "k_dpmpp_sde", | |
| "ddim_v3", | |
| ] | |
| # Noise Schedule choices (NAIA2.0 order: karras first as default) | |
| NOISE_SCHEDULE_CHOICES = [ | |
| "karras", | |
| "native", | |
| "exponential", | |
| "polyexponential", | |
| ] | |
| # Default generation parameters | |
| DEFAULT_STEPS = 28 | |
| DEFAULT_SCALE = 5.0 | |
| DEFAULT_SAMPLER = "k_euler" | |
| DEFAULT_NOISE_SCHEDULE = "karras" | |
| DEFAULT_RESOLUTION = "832 x 1216" | |
| DEFAULT_MODEL = "NAID4.5F" | |
| # Quality tags (automatically added) | |
| QUALITY_TAGS_POSITIVE = "best quality, amazing quality, very aesthetic, absurdres" | |
| QUALITY_TAGS_NEGATIVE = ( | |
| "lowres, {bad}, error, fewer, extra, missing, worst quality, " | |
| "jpeg artifacts, bad quality, watermark, unfinished, displeasing, " | |
| "chromatic aberration, signature, extra digits, artistic error, " | |
| "username, scan, [abstract]" | |
| ) | |
| # Quick Search - Person categories | |
| PERSON_CATEGORIES = [ | |
| '1girl_solo', '1boy_solo', '1girl', '1boy', '1girl_1boy', | |
| '1girl_multiple_boys', '1boy_multiple_girls', | |
| '2girls', '2boys', 'multiple_girls', 'multiple_boys', | |
| 'multiple_girls_multiple_boys', 'other', | |
| ] | |
| # Person category labels (for display) | |
| PERSON_LABELS = { | |
| '1girl_solo': '1 Girl Solo', | |
| '1boy_solo': '1 Boy Solo', | |
| '1girl': '1 Girl', | |
| '1boy': '1 Boy', | |
| '1girl_1boy': '1 Girl + 1 Boy', | |
| '1girl_multiple_boys': '1 Girl + Boys', | |
| '1boy_multiple_girls': '1 Boy + Girls', | |
| '2girls': '2 Girls', | |
| '2boys': '2 Boys', | |
| 'multiple_girls': 'Multiple Girls', | |
| 'multiple_boys': 'Multiple Boys', | |
| 'multiple_girls_multiple_boys': 'Multiple Mixed', | |
| 'other': 'Other', | |
| } | |
| # Person category auto-tags (tags automatically added when category selected) | |
| PERSON_AUTO_TAGS = { | |
| '1girl_solo': ['1girl', 'solo'], | |
| '1boy_solo': ['1boy', 'solo'], | |
| '1girl': ['1girl'], | |
| '1boy': ['1boy'], | |
| '1girl_1boy': ['1girl', '1boy'], | |
| '1girl_multiple_boys': ['1girl'], | |
| '1boy_multiple_girls': ['1boy'], | |
| '2girls': ['2girls'], | |
| '2boys': ['2boys'], | |
| 'multiple_girls': ['multiple girls'], | |
| 'multiple_boys': ['multiple boys'], | |
| 'multiple_girls_multiple_boys': [], | |
| 'other': [], | |
| } | |
| # Rating options (code -> display name) | |
| RATING_OPTIONS = ['g', 's', 'q', 'e'] | |
| RATING_LABELS = { | |
| 'g': 'General', | |
| 's': 'Sensitive', | |
| 'q': 'Questionable', | |
| 'e': 'Explicit', | |
| } | |
| # Rating suffix tags (added to end of prompt when generating random prompts) | |
| RATING_SUFFIX_TAGS = { | |
| 'g': ['rating:general'], | |
| 's': ['rating:sensitive'], | |
| 'q': ['rating:questionable'], | |
| 'e': ['rating:explicit', 'nsfw'], | |
| } | |
| # NAI API configuration | |
| NAI_API_URL = "https://image.novelai.net/ai/generate-image" | |