Removes nine unused exports from the base-model.constants.ts compatibility section of basemodel.constants.ts. Each had no consumer anywhere in the repo outside the legacy base-model.constants.ts file (deleted separately in #3425). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
23 KiB
Guide: Adding New Base Models & Ecosystems
Purpose: This guide provides step-by-step instructions and critical questions for adding new base models and ecosystems to basemodel.constants.ts.
When to use: When a new AI model needs to be added to the platform for generation, training, or auction support.
Table of Contents
- Overview & Key Concepts
- Decision Tree
- Information Gathering Questions
- Step-by-Step Implementation
- Examples
- Validation Checklist
Overview & Key Concepts
Architecture Components
The basemodel.constants.ts file uses an ecosystem-based architecture with these key components:
-
Ecosystems (
EcosystemRecord): Organizational units representing model families- Has:
id,key,name,displayName,description,parentEcosystemId,familyId,sortOrder - Example: "SDXL", "Flux1", "WanVideo14B_T2V"
- Can have parent-child relationships (e.g., Pony is a child of SDXL)
- Has:
-
Base Models (
BaseModelRecord): Specific model variants within an ecosystem- Has:
id,name,description,type(image/video),ecosystemId,licenseId,hidden,disabled,experimental - Example: "SDXL 1.0", "Flux.1 D", "Wan Video 14B t2v"
- Always belongs to exactly one ecosystem
- Has:
-
Ecosystem Support (
EcosystemSupport): Defines what model types each ecosystem supports- Supports:
generation,training,auction - Model types:
Checkpoint,LORA,TextualInversion,Controlnet, etc. - Can be disabled with
disabled: true
- Supports:
-
Ecosystem Settings (
EcosystemSettings): Default parameters for generationmodel(default checkpoint),modelLocked,engine(orchestrator engine identifier)
-
Cross-Ecosystem Rules (
CrossEcosystemRule): Defines partial compatibility between ecosystems- Example: SD1 TextualInversion works in SDXL
- Always
support: 'partial'
-
Licenses (
LicenseRecord): Legal terms for model usage- Has:
id,name,url,notice,poweredBy,disableMature
- Has:
Decision Tree
New Model Request
│
├─ Is this a new family/brand? (e.g., first Google model, first ByteDance model)
│ └─ YES: Create new ECOSYSTEM + BASE MODEL + FAMILY (if needed)
│
├─ Is this a variant of existing ecosystem? (e.g., Flux.2 Klein 9B vs Flux.1)
│ └─ YES: Create new ECOSYSTEM + BASE MODEL (variant)
│
├─ Is this a fine-tune/derivative of existing model? (e.g., Pony based on SDXL)
│ └─ YES: Create new ECOSYSTEM (child) + BASE MODEL
│
└─ Is this just a checkpoint within existing ecosystem? (e.g., SDXL 0.9 vs SDXL 1.0)
└─ YES: Create BASE MODEL only
Information Gathering Questions
Essential Questions (Always Ask)
-
What is the model name?
- Full official name (e.g., "Flux.2 Klein 9B", "Wan Video 2.5 T2V")
- How should it display in UI? (displayName)
-
What type of media does it generate?
imageorvideo?
-
What ecosystem does it belong to?
- Is it part of an existing family (SDXL, Flux, WanVideo, etc.)?
- Or is this a completely new ecosystem?
-
What is the license?
- Open source? What license? (Apache 2.0, CreativeML, etc.)
- Commercial restrictions?
- NSFW restrictions? (
disableMature: true) - License URL/documentation?
- Any required notices or powered-by text?
-
What model types does it support?
- Checkpoint only? (
checkpointOnly) - Checkpoint + LORA? (
checkpointAndLora) - Full addon support? (Checkpoint, LORA, TextualInversion, Controlnet, etc.) (
fullAddonTypes) - LORA only? (
loraOnly)
- Checkpoint only? (
-
What capabilities does it have?
- Generation support? (yes/no)
- Training support? (can users train LoRAs on it?)
- Auction support? (can it be used in bounties/auctions?)
Contextual Questions (Ask When Relevant)
-
Is this model ready for production?
- Should it be hidden initially? (
hidden: true) - Is it experimental/beta? (
experimental: true) - Is it completely disabled? (
disabled: true)
- Should it be hidden initially? (
-
Parent/Child Relationships
- Is this a fine-tune of another ecosystem? (e.g., Pony is child of SDXL)
- Should it inherit support from parent?
- If yes, what is the parent ecosystem?
-
Cross-Ecosystem Compatibility
- Can resources from other ecosystems work with this model?
- Examples: Can SD1 embeddings work here? Can Flux1 LORAs work here?
- Which specific model types are compatible?
-
Default Generation Settings
- What engine should be used? (e.g., "wan", "hunyuan", "veo3", "sora2")
- Default sampler? (e.g., "Euler a", "DPM++ 2M Karras")
- Default steps? CFG scale?
- Default resolution (width x height)?
- Is the model/checkpoint locked (user cannot change it)? Common for video models.
-
Family Grouping
- Should this be grouped with related models in the UI?
- What family does it belong to?
- Flux Family (familyId: 1)
- Stable Diffusion Family (familyId: 2)
- Google Models (familyId: 3)
- New family?
-
Sort Order
- Where should this appear in lists relative to similar models?
Step-by-Step Implementation
Step 1: Add Ecosystem ID Constant (if new ecosystem)
Location: Line ~111 in ECO constant object
export const ECO = {
// ... existing ecosystems ...
NewEcosystem: 59, // Use next available ID
} as const;
ID Ranges:
- 1-99: Root ecosystems
- 100-199: Child ecosystems (SDXL derivatives)
- 200-299: Child ecosystems (AuraFlow derivatives)
Step 2: Add Base Model ID Constant
Location: Line ~1535 in BM constant object
export const BM = {
// ... existing base models ...
NewModel: 100, // Use next available ID
} as const;
Step 3: Add License (if new license)
Location: Line ~1632 in licenses array
{
id: 25, // Next available ID
name: 'License Name',
url: 'https://...',
notice: 'Optional legal notice text',
poweredBy: 'Optional powered by text',
disableMature: true, // If NSFW content is restricted
},
Step 4: Add Ecosystem Family (if new family)
Location: Line ~1792 in ecosystemFamilies array
{
id: 5, // Next available ID
name: 'Family Name',
description: 'Brief description of this model family',
},
Step 5: Add Ecosystem Record
Location: Line ~190 in ecosystems array (grouped by family)
{
id: ECO.NewEcosystem,
key: 'NewEcosystem', // Stable identifier (no spaces)
name: 'newecosystem', // Lowercase for matching
displayName: 'New Ecosystem', // Human-readable name for UI
description: 'Brief description', // Optional: for UI tooltips/help
parentEcosystemId: ECO.Parent, // Optional: if this is a child ecosystem
familyId: 1, // Optional: for UI grouping
sortOrder: 10, // Optional: for UI ordering
},
Step 6: Add Base Model Record
Location: Line ~1883 in baseModelRecords array (grouped by ecosystem)
{
id: BM.NewModel,
name: 'New Model Name',
description: 'Model description for UI',
type: 'image', // or 'video'
ecosystemId: ECO.NewEcosystem,
licenseId: 13, // Reference to license
hidden: false, // Set to true to hide from activeBaseModels
disabled: false, // Set to true to completely disable
experimental: false, // Set to true to show experimental warning
},
Step 7: Add Ecosystem Support
Location: Line ~713 in ecosystemSupport array
Common patterns:
// Pattern 1: Checkpoint only (most API/closed-source models)
{
ecosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: checkpointOnly
},
// Pattern 2: Checkpoint + LORA (common for open models)
{
ecosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: checkpointAndLora
},
{
ecosystemId: ECO.NewEcosystem,
supportType: 'training',
modelTypes: [ModelType.LORA]
},
// Pattern 3: Full addon support (SD-based models)
{
ecosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: fullAddonTypes
},
{
ecosystemId: ECO.NewEcosystem,
supportType: 'training',
modelTypes: [ModelType.LORA]
},
{
ecosystemId: ECO.NewEcosystem,
supportType: 'auction',
modelTypes: checkpointAndLora
},
// Pattern 4: LORA only (for models that require a base checkpoint)
{
ecosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: loraOnly
},
// Pattern 5: Disabled (model exists but generation is disabled)
{
ecosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: checkpointOnly,
disabled: true
},
Available model type arrays:
checkpointOnly=[ModelType.Checkpoint]loraOnly=[ModelType.LORA]checkpointAndLora=[ModelType.Checkpoint, ModelType.LORA]fullAddonTypes=[ModelType.Checkpoint, ModelType.LORA, ModelType.TextualInversion, ModelType.Controlnet]
Step 8: Add Ecosystem Settings (if needed)
Location: Line ~845 in ecosystemSettings array
When to add: If the model needs specific default parameters or engine configuration.
{
ecosystemId: ECO.NewEcosystem,
defaults: {
engine: 'engineName', // Orchestrator engine identifier (required for video models)
modelLocked: true, // Optional: true for video models (user can't change base)
model: { id: BM.NewModel },// Optional: default checkpoint model
},
},
Note: Generation parameters like sampler, steps, CFG, and resolution are configured in data-graph workflow configs, not in ecosystem settings.
Common engines:
'wan'- WanVideo models'hunyuan'- Hunyuan models'veo3'- Veo3'vidu'- Vidu'kling'- Kling'seedance'- Seedance'lightricks'- LTXV'ltx2'- LTXV2/LTXV2.3
Step 9: Add Cross-Ecosystem Rules (if applicable)
Location: Line ~1187 in crossEcosystemRules array
When to add: When resources from one ecosystem can work (with partial support) in another.
{
sourceEcosystemId: ECO.SourceEcosystem,
targetEcosystemId: ECO.NewEcosystem,
supportType: 'generation',
modelTypes: [ModelType.LORA], // or other types
support: 'partial', // Always 'partial'
},
Common cross-ecosystem patterns:
- SD1 TextualInversion → SDXL family
- SDXL ↔ Pony/Illustrious/NoobAI (
sdxlCrossAddonTypes— parent↔child, includes VAE) - Pony ↔ Illustrious ↔ NoobAI (
sdxlSiblingAddonTypes— siblings, no VAE) - Flux1 ↔ FluxKrea (LORA + Checkpoint)
- WanVideo 2.2 LORA → WanVideo 14B variants
Examples
Example 1: New Closed-Source API Model (Checkpoint Only)
Scenario: Adding "Imagen 5" from Google
Answers:
- Name: "Imagen 5"
- Type: image
- Ecosystem: New ecosystem (Imagen5)
- License: Google proprietary (id: 21)
- Model types: Checkpoint only
- Capabilities: Generation only
- Ready: Yes, not hidden
- Parent: None
- Cross-ecosystem: None
- Settings: No special engine needed
- Family: Google Models (familyId: 3)
Implementation:
// 1. Add ecosystem ID
export const ECO = {
// ...
Imagen5: 60,
} as const;
// 2. Add base model ID
export const BM = {
// ...
Imagen5: 101,
} as const;
// 3. License already exists (Google proprietary, id: 21)
// 4. Family already exists (Google Models, familyId: 3)
// 5. Add ecosystem
ecosystems: [
// ... in Google family section ...
{
id: ECO.Imagen5,
key: 'Imagen5',
name: 'imagen5',
displayName: 'Imagen 5',
description: 'Google\'s latest text-to-image model',
familyId: 3,
sortOrder: 22,
},
]
// 6. Add base model
baseModelRecords: [
// ... in Imagen section ...
{
id: BM.Imagen5,
name: 'Imagen5',
description: 'Text-to-image model with enhanced capabilities',
type: 'image',
ecosystemId: ECO.Imagen5,
licenseId: 21,
},
]
// 7. Add support
ecosystemSupport: [
// ...
{ ecosystemId: ECO.Imagen5, supportType: 'generation', modelTypes: checkpointOnly },
]
// 8. No settings needed (standard image generation)
// 9. No cross-ecosystem rules needed
Example 2: New Open-Source Model (Checkpoint + LORA)
Scenario: Adding "DreamFlow 1.0" - open-source image model
Answers:
- Name: "DreamFlow 1.0"
- Type: image
- Ecosystem: New ecosystem (DreamFlow)
- License: Apache 2.0 (id: 13)
- Model types: Checkpoint + LORA
- Capabilities: Generation + Training + Auction
- Ready: Yes
- Parent: None
- Cross-ecosystem: None initially
- Settings: None (standard defaults)
- Family: New family
Implementation:
// 1. Add ecosystem ID
export const ECO = {
// ...
DreamFlow: 61,
} as const;
// 2. Add base model ID
export const BM = {
// ...
DreamFlow10: 102,
} as const;
// 3. License exists (Apache 2.0, id: 13)
// 4. Add new family
ecosystemFamilies: [
// ...
{ id: 6, name: 'DreamFlow', description: 'Open-source creative generation models' },
]
// 5. Add ecosystem
ecosystems: [
// ...
{
id: ECO.DreamFlow,
key: 'DreamFlow',
name: 'dreamflow',
displayName: 'DreamFlow',
description: 'Open-source creative text-to-image model',
familyId: 6,
sortOrder: 0,
},
]
// 6. Add base model
baseModelRecords: [
// ...
{
id: BM.DreamFlow10,
name: 'DreamFlow 1.0',
description: 'First generation DreamFlow model',
type: 'image',
ecosystemId: ECO.DreamFlow,
licenseId: 13,
},
]
// 7. Add support (full support: generation, training, auction)
ecosystemSupport: [
// ...
{ ecosystemId: ECO.DreamFlow, supportType: 'generation', modelTypes: checkpointAndLora },
{ ecosystemId: ECO.DreamFlow, supportType: 'training', modelTypes: [ModelType.LORA] },
{ ecosystemId: ECO.DreamFlow, supportType: 'auction', modelTypes: checkpointAndLora },
]
// 8. No special settings needed
// 9. No cross-ecosystem rules initially
Example 3: Video Model with Engine
Scenario: Adding "VidGen Pro" - proprietary video model
Answers:
- Name: "VidGen Pro"
- Type: video
- Ecosystem: New (VidGenPro)
- License: Custom proprietary
- Model types: Checkpoint only
- Capabilities: Generation only
- Ready: Yes
- Parent: None
- Cross-ecosystem: None
- Settings: Requires engine "vidgen", model locked, default resolution 1280x720
- Family: New family
Implementation:
// 1. Add ecosystem ID
export const ECO = {
// ...
VidGenPro: 62,
} as const;
// 2. Add base model ID
export const BM = {
// ...
VidGenPro: 103,
} as const;
// 3. Add new license
licenses: [
// ...
{
id: 26,
name: 'VidGen Pro License',
url: 'https://vidgen.com/license',
notice: 'VidGen Pro is licensed for commercial use with attribution.',
poweredBy: 'Powered by VidGen',
},
]
// 4. Add new family
ecosystemFamilies: [
// ...
{ id: 7, name: 'VidGen', description: 'VidGen video generation models' },
]
// 5. Add ecosystem
ecosystems: [
// ...
{
id: ECO.VidGenPro,
key: 'VidGenPro',
name: 'vidgenpro',
displayName: 'VidGen Pro',
description: 'Professional video generation model',
familyId: 7,
sortOrder: 0,
},
]
// 6. Add base model
baseModelRecords: [
// ...
{
id: BM.VidGenPro,
name: 'VidGen Pro',
description: 'Professional-grade text-to-video generation',
type: 'video',
ecosystemId: ECO.VidGenPro,
licenseId: 26,
},
]
// 7. Add support
ecosystemSupport: [
// ...
{ ecosystemId: ECO.VidGenPro, supportType: 'generation', modelTypes: checkpointOnly },
]
// 8. Add settings (REQUIRED for video models with custom engine)
ecosystemSettings: [
// ...
{
ecosystemId: ECO.VidGenPro,
defaults: {
engine: 'vidgen',
modelLocked: true, // User cannot change the base model
model: { id: BM.VidGenPro }, // Default checkpoint
},
},
]
// Note: Resolution, sampler, steps, CFG are configured in data-graph workflow configs
// 9. No cross-ecosystem rules
Example 4: Child Ecosystem (Fine-tune)
Scenario: Adding "AnimeXL" - a fine-tune of SDXL specialized for anime
Answers:
- Name: "AnimeXL"
- Type: image
- Ecosystem: Child of SDXL
- License: Same as SDXL (CreativeML Open RAIL++-M, id: 3)
- Model types: Inherits from SDXL (full addon support)
- Capabilities: Inherits from SDXL (generation, training, auction)
- Ready: Yes
- Parent: SDXL (ECO.SDXL)
- Cross-ecosystem: Inherits SDXL cross-ecosystem rules
- Settings: Uses SDXL defaults
- Family: Stable Diffusion Family (familyId: 2)
Implementation:
// 1. Add ecosystem ID (child ecosystem range: 100-199 for SDXL derivatives)
export const ECO = {
// ...
AnimeXL: 103,
} as const;
// 2. Add base model ID
export const BM = {
// ...
AnimeXL: 104,
} as const;
// 3. License exists (id: 3)
// 4. Family exists (Stable Diffusion, familyId: 2)
// 5. Add ecosystem WITH parentEcosystemId
ecosystems: [
// ... in SDXL family section ...
{
id: ECO.AnimeXL,
key: 'AnimeXL',
name: 'animexl',
displayName: 'AnimeXL',
description: 'SDXL fine-tuned for anime-style generation',
parentEcosystemId: ECO.SDXL, // IMPORTANT: marks as child
familyId: 2,
sortOrder: 15,
},
]
// 6. Add base model
baseModelRecords: [
// ... in SDXL section ...
{
id: BM.AnimeXL,
name: 'AnimeXL',
description: 'SDXL model specialized for anime and manga styles',
type: 'image',
ecosystemId: ECO.AnimeXL,
licenseId: 3,
},
]
// 7. NO ecosystem support needed - inherits from parent (SDXL)
// Child ecosystems automatically inherit parent's support configuration
// 8. NO settings needed - uses parent defaults
// 9. Cross-ecosystem rules are EXPLICIT - they do NOT inherit from parent
// You must add rules for each ecosystem that needs cross-compatibility
// Use sdxlCrossAddonTypes for parent↔child (includes VAE)
// Use sdxlSiblingAddonTypes for sibling↔sibling (no VAE)
{ sourceEcosystemId: ECO.SDXL, targetEcosystemId: ECO.AnimeXL, supportType: 'generation', modelTypes: sdxlCrossAddonTypes, support: 'partial' },
{ sourceEcosystemId: ECO.AnimeXL, targetEcosystemId: ECO.SDXL, supportType: 'generation', modelTypes: sdxlCrossAddonTypes, support: 'partial' },
// Also add sibling rules with other SDXL children (Pony, Illustrious, NoobAI, etc.)
Validation Checklist
After adding a new model, verify:
Code Completeness
- Added ecosystem ID constant in
ECOobject (if new ecosystem) - Added base model ID constant in
BMobject - Added license record (if new license)
- Added ecosystem family record (if new family)
- Added ecosystem record in
ecosystemsarray - Added base model record in
baseModelRecordsarray - Added ecosystem support in
ecosystemSupportarray - Added ecosystem settings in
ecosystemSettingsarray (if needed) - Added cross-ecosystem rules in
crossEcosystemRulesarray (if applicable)
ID Management
- Used unique, sequential IDs (no conflicts)
- Used appropriate ID range (1-99 for root, 100+ for children)
- No duplicate ecosystem keys
- No duplicate base model names within ecosystem
Correctness
- Media type matches model capability (image vs video)
- License restrictions match model terms
- Model types array matches actual support
- Parent-child relationship correct (if child ecosystem)
- Settings appropriate for model type (engine for video, etc.)
- Cross-ecosystem rules make technical sense
Testing
- TypeScript compiles without errors (
pnpm run typecheck) - Model appears in
baseModelsarray export - Model appears in
activeBaseModelsif not hidden - Ecosystem appears in
baseModelGroupsarray export getBaseModelGenerationConfig()includes new ecosystem (if has generation support)
Documentation
- Updated this guide with new patterns (if introducing new pattern)
- Added example if significantly different from existing models
- Documented any special considerations in code comments
Common Patterns Quick Reference
Pattern: Standard Open-Source Image Model
// Ecosystem: New root ecosystem
// Support: Checkpoint + LORA for generation, LORA for training, auction support
// License: Apache 2.0 or CreativeML
Pattern: Closed-Source API Model
// Ecosystem: New root ecosystem
// Support: Checkpoint only for generation
// License: Proprietary
// Hidden: May start hidden (hidden: true) until ready
Pattern: Video Model
// Ecosystem: New root ecosystem
// Support: Checkpoint only or Checkpoint + LORA
// Settings: MUST have engine, usually modelLocked: true
// License: Varies
Pattern: Fine-tune/Derivative
// Ecosystem: Child ecosystem (set parentEcosystemId)
// Support: Inherits from parent (no explicit support needed)
// License: Often same as parent
Pattern: Experimental/Beta Model
// Base Model: experimental: true
// May also be: hidden: true initially
Pattern: Deprecated/Disabled Model
// Base Model: disabled: true
// Ecosystem Support: disabled: true (if just disabling generation)
Notes
Hidden vs Disabled
- Hidden (
hidden: true): Model exists but doesn't appear in activeBaseModels. Can still have generation/training support via API. - Disabled (
disabled: true): Completely disables ALL functionality (generation, training, auction). Model is deprecated.
Model Types
- Checkpoint: The base model itself
- LORA: Low-Rank Adaptation (fine-tuning method)
- TextualInversion: Embedding/concept injection
- Controlnet: Conditional control (pose, depth, etc.)
- Hypernetwork: Neural network modifier
- VAE: Variational Autoencoder (color/detail adjustment)
- Upscaler: Resolution enhancement
- MotionModule: Animation/motion control
- Poses: Pose templates
- Wildcards: Dynamic prompt templates
- Workflows: Complete generation pipelines
Support Types
- generation: Model can be used for image/video generation
- training: Users can train LoRAs on this model
- auction: Model can be used in bounties/competitions
Inheritance
- Child ecosystems (with
parentEcosystemId) automatically inherit:- Ecosystem support configuration
- Ecosystem settings (defaults)
- Cross-ecosystem rules are NOT inherited — they must be added explicitly for each ecosystem pair
- Use
sdxlCrossAddonTypes(includes VAE) for parent↔child rules andsdxlSiblingAddonTypes(no VAE) for sibling↔sibling rules
Getting Help
If you encounter any of these situations:
- Unclear license terms → Ask user for official license URL and restrictions
- Unknown model architecture → Ask if it's compatible with existing ecosystems
- Uncertain about compatibility → Conservative approach: no cross-ecosystem rules initially
- New model type → Check if it's a variant of existing types or truly new
- Complex parent-child relationship → Verify technical compatibility with parent
Always prefer asking clarifying questions over making assumptions.