feat(constants): standardize formatting and expand diffusion model list

- Normalize string quotes to double quotes across all constants for consistency
- Add trailing commas in dictionaries and lists to improve diff readability
- Expand DIFFUSION_MODEL_BASE_MODELS with additional Wan Video and Qwen models
- Fix comment spacing in NSFW_LEVELS dictionary
- Maintain all existing functionality while improving code style
This commit is contained in:
Will Miao
2026-01-19 01:20:46 +08:00
parent b0f0158f98
commit 1dee7f5cf9

View File

@@ -4,14 +4,14 @@ NSFW_LEVELS = {
"R": 4, "R": 4,
"X": 8, "X": 8,
"XXX": 16, "XXX": 16,
"Blocked": 32, # Probably not actually visible through the API without being logged in on model owner account? "Blocked": 32, # Probably not actually visible through the API without being logged in on model owner account?
} }
# Node type constants # Node type constants
NODE_TYPES = { NODE_TYPES = {
"Lora Loader (LoraManager)": 1, "Lora Loader (LoraManager)": 1,
"Lora Stacker (LoraManager)": 2, "Lora Stacker (LoraManager)": 2,
"WanVideo Lora Select (LoraManager)": 3 "WanVideo Lora Select (LoraManager)": 3,
} }
# Default ComfyUI node color when bgcolor is null # Default ComfyUI node color when bgcolor is null
@@ -19,18 +19,18 @@ DEFAULT_NODE_COLOR = "#353535"
# preview extensions # preview extensions
PREVIEW_EXTENSIONS = [ PREVIEW_EXTENSIONS = [
'.webp', ".webp",
'.preview.webp', ".preview.webp",
'.preview.png', ".preview.png",
'.preview.jpeg', ".preview.jpeg",
'.preview.jpg', ".preview.jpg",
'.preview.mp4', ".preview.mp4",
'.png', ".png",
'.jpeg', ".jpeg",
'.jpg', ".jpg",
'.mp4', ".mp4",
'.gif', ".gif",
'.webm' ".webm",
] ]
# Card preview image width # Card preview image width
@@ -41,43 +41,70 @@ EXAMPLE_IMAGE_WIDTH = 832
# Supported media extensions for example downloads # Supported media extensions for example downloads
SUPPORTED_MEDIA_EXTENSIONS = { SUPPORTED_MEDIA_EXTENSIONS = {
'images': ['.jpg', '.jpeg', '.png', '.webp', '.gif'], "images": [".jpg", ".jpeg", ".png", ".webp", ".gif"],
'videos': ['.mp4', '.webm'] "videos": [".mp4", ".webm"],
} }
# Valid Lora types # Valid Lora types
VALID_LORA_TYPES = ['lora', 'locon', 'dora'] VALID_LORA_TYPES = ["lora", "locon", "dora"]
# Supported Civitai model types for user model queries (case-insensitive) # Supported Civitai model types for user model queries (case-insensitive)
CIVITAI_USER_MODEL_TYPES = [ CIVITAI_USER_MODEL_TYPES = [
*VALID_LORA_TYPES, *VALID_LORA_TYPES,
'textualinversion', "textualinversion",
'checkpoint', "checkpoint",
] ]
# Default chunk size in megabytes used for hashing large files. # Default chunk size in megabytes used for hashing large files.
DEFAULT_HASH_CHUNK_SIZE_MB = 4 DEFAULT_HASH_CHUNK_SIZE_MB = 4
# Auto-organize settings # Auto-organize settings
AUTO_ORGANIZE_BATCH_SIZE = 50 # Process models in batches to avoid overwhelming the system AUTO_ORGANIZE_BATCH_SIZE = (
50 # Process models in batches to avoid overwhelming the system
)
# Civitai model tags in priority order for subfolder organization # Civitai model tags in priority order for subfolder organization
CIVITAI_MODEL_TAGS = [ CIVITAI_MODEL_TAGS = [
'character', 'concept', 'clothing', "character",
'realistic', 'anime', 'toon', 'furry', 'style', "concept",
'poses', 'background', 'tool', 'vehicle', 'buildings', "clothing",
'objects', 'assets', 'animal', 'action' "realistic",
"anime",
"toon",
"furry",
"style",
"poses",
"background",
"tool",
"vehicle",
"buildings",
"objects",
"assets",
"animal",
"action",
] ]
# Default priority tag configuration strings for each model type # Default priority tag configuration strings for each model type
DEFAULT_PRIORITY_TAG_CONFIG = { DEFAULT_PRIORITY_TAG_CONFIG = {
'lora': ', '.join(CIVITAI_MODEL_TAGS), "lora": ", ".join(CIVITAI_MODEL_TAGS),
'checkpoint': ', '.join(CIVITAI_MODEL_TAGS), "checkpoint": ", ".join(CIVITAI_MODEL_TAGS),
'embedding': ', '.join(CIVITAI_MODEL_TAGS), "embedding": ", ".join(CIVITAI_MODEL_TAGS),
} }
# baseModel values from CivitAI that should be treated as diffusion models (unet) # baseModel values from CivitAI that should be treated as diffusion models (unet)
# These model types are incorrectly labeled as "checkpoint" by CivitAI but are actually diffusion models # These model types are incorrectly labeled as "checkpoint" by CivitAI but are actually diffusion models
DIFFUSION_MODEL_BASE_MODELS = frozenset([ DIFFUSION_MODEL_BASE_MODELS = frozenset(
"ZImageTurbo", [
]) "ZImageTurbo",
"Wan Video 1.3B t2v",
"Wan Video 14B t2v",
"Wan Video 14B i2v 480p",
"Wan Video 14B i2v 720p",
"Wan Video 2.2 TI2V-5B",
"Wan Video 2.2 I2V-A14B",
"Wan Video 2.2 T2V-A14B",
"Wan Video 2.5 T2V",
"Wan Video 2.5 I2V",
"Qwen",
]
)