-
-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing
The Duskfall Portal Crew edited this page Jun 12, 2026
·
1 revision
Guidelines for contributing to the Ktiseos Nyx Trainer project.
- Search existing issues before creating new reports
- Include: GPU model, OS, Python and Node.js versions, browser
- Specify: local or cloud deployment
- Attach
diagnostics_*.txtoutput - Provide clear reproduction steps
- Review existing issues and discussions for similar requests
- Clearly articulate the problem your feature solves
- Provide specific implementation details
Priority areas:
- Frontend UI — React component improvements, user experience
- API Layer — FastAPI endpoint fixes, validation improvements
- Dataset Management — Upload workflows, tagging, captioning
- Training Integration — Kohya SS parameter support, TOML generation
- Performance — Memory optimization, training speed
- Documentation — Code docs, user guides, examples
- Platform Support — Cross-platform compatibility
- Fork and clone the repository
- Create a descriptive branch (e.g.
feature/dataset-validation,fix/training-toml-bug) -
python installer.py— set up backend dependencies -
cd frontend && npm install— set up frontend - Start services for testing
| Layer | Technology | Key Files |
|---|---|---|
| Frontend | Next.js 16, React 19, TypeScript |
frontend/app/, frontend/components/
|
| UI Components | shadcn/ui (Radix primitives) | frontend/components/ui/ |
| API Client | Typed fetch wrapper | frontend/lib/api.ts |
| Validation | Zod (frontend), Pydantic (backend) |
frontend/lib/validation.ts, services/models/
|
| API Routes | FastAPI | api/routes/ |
| Services | Python business logic | services/ |
| Training | Vendored Kohya SS + LyCORIS | trainer/derrian_backend/ |
| Config Generation | TOML | services/trainers/kohya_toml.py |
TypeScript / Frontend:
- Always use shadcn/ui components — never raw
<input>,<select>,<button> - Use
@/path aliases for imports - All components must be TypeScript
-
'use client'for components with state, effects, or event handlers - Follow accessibility best practices (semantic HTML, ARIA, keyboard nav)
- API calls go through
lib/api.ts
Python / Backend:
- PEP 8 with reasonable flexibility
- Pydantic models with
Field()descriptions for all request/response types -
Literaltypes for enum validation on API route models - Type hints for all function parameters and return values
- Cross-platform file paths (
os.path.join(),pathlib.Path) - Do not lint or reformat
trainer/derrian_backend/
When adding features, update all three layers consistently:
-
Frontend (
lib/api.ts,lib/validation.ts) — TypeScript types and Zod schemas -
API Route (
api/routes/) — FastAPI endpoint with route-level Pydantic model -
Service Layer (
services/) — Business logic with service-level Pydantic model
Field names, types, and defaults must match across all layers.
Pre-submission:
-
npx tsc --noEmitinfrontend/— must pass cleanly -
npm run buildinfrontend/— must complete without errors - Confirm intended behavior works in browser
- Check edge cases and invalid inputs
- Verify existing functionality is unaffected
Running tests:
pip install -r requirements_dev.txt
pytest tests/test_api_plumbing.py -v
Tests are GPU-free and mock all ML dependencies. New tests go in tests/. Tests requiring a real GPU: mark with @pytest.mark.slow.
- Clear explanation of changes and their purpose
- Reference related issues (
Fixes #numberorRelated to #number) - Respond constructively to code review feedback
- Update documentation to reflect behavioral changes
- Do not add Jupyter notebook references to any file
-
Do not modify vendored code in
trainer/derrian_backend/without discussion -
Do not run
git submodulecommands — there are no submodules -
Do not change
0.0.0.0server bindings - Do not hardcode absolute paths
- Do not write macOS-only or Unix-only code
- Do not create markdown audit files unless asked
-
Do not add platform-specific npm packages directly (causes
EBADPLATFORMon other OSes)
By submitting contributions, you agree that:
- Your contributions are licensed under the project's MIT license
- You have legal rights to submit the contributed code
- Your contributions do not violate third-party copyrights or licenses
- General questions: GitHub Discussions
- Technical issues: Search existing issues before creating new ones
- Specific problems: Comment on relevant PRs or issues
This project is built with neurodivergent-friendly workflows — clear structure, consistent patterns, and helpful error messages are valued.