mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
## Summary Tested these changes and confirmed that: 1. Feedback button shows. 2. You can run workflows and switch out models. 3. You can use the mask editor. (thank you @ric-yu for helping me verify). ## Changes A lot, please see commits. Gets us up to date with `main` as of 10-11-2025. --------- Co-authored-by: Simula_r <18093452+simula-r@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: snomiao <snomiao@gmail.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: DrJKL <DrJKL@users.noreply.github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Marwan Ahmed <155799754+marawan206@users.noreply.github.com> Co-authored-by: DrJKL <DrJKL0424@gmail.com> Co-authored-by: Rizumu Ayaka <rizumu@ayaka.moe> Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com> Co-authored-by: AustinMroz <4284322+AustinMroz@users.noreply.github.com> Co-authored-by: Austin Mroz <austin@comfy.org> Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com> Co-authored-by: Benjamin Lu <benceruleanlu@proton.me> Co-authored-by: Jin Yi <jin12cc@gmail.com> Co-authored-by: Robin Huang <robin.j.huang@gmail.com>
4.0 KiB
4.0 KiB
ComfyUI Frontend Project Guidelines
Repository Setup
For first-time setup, use the Claude command:
/setup_repo
This bootstraps the monorepo with dependencies, builds, tests, and dev server verification.
Prerequisites: Node.js >= 24, Git repository, available ports (5173, 6006)
Quick Commands
pnpm: See all available commandspnpm dev: Start development server (port 5173, via nx)pnpm typecheck: Type checkingpnpm build: Build for production (via nx)pnpm lint: Linting (via nx)pnpm format: Prettier formattingpnpm test:unit: Run all unit testspnpm test:browser: Run E2E tests via Playwrightpnpm test:unit -- tests-ui/tests/example.test.ts: Run single test filepnpm storybook: Start Storybook development server (port 6006)pnpm knip: Detect unused code and dependencies
Monorepo Architecture
The project now uses Nx for build orchestration and task management:
- Task Orchestration: Commands like
dev,build,lint, andtest:browserrun via Nx - Caching: Nx provides intelligent caching for faster rebuilds
- Configuration: Managed through
nx.jsonwith plugins for ESLint, Storybook, Vite, and Playwright - Dependencies: Nx handles dependency graph analysis and parallel execution
Key Nx features:
- Build target caching and incremental builds
- Parallel task execution across the monorepo
- Plugin-based architecture for different tools
Development Workflow
- First-time setup: Run
/setup_repoClaude command - Make code changes
- Run tests (see subdirectory CLAUDE.md files)
- Run typecheck, lint, format
- Check README updates
- Consider docs.comfy.org updates
Git Conventions
- Use [prefix] format: [feat], [bugfix], [docs]
- Add "Fixes #n" to PR descriptions
- Never mention Claude/AI in commits
External Resources
- PrimeVue docs: https://primevue.org
- ComfyUI docs: https://docs.comfy.org
- Electron: https://www.electronjs.org/docs/latest/
- Wiki: https://deepwiki.com/Comfy-Org/ComfyUI_frontend/1-overview
Project Philosophy
- Clean, stable public APIs
- Domain-driven design
- Thousands of users and extensions
- Prioritize clean interfaces that restrict extension access
Repository Navigation
- Check README files in key folders (tests-ui, browser_tests, composables, etc.)
- Prefer running single tests for performance
- Use --help for unfamiliar CLI tools
GitHub Integration
When referencing Comfy-Org repos:
- Check for local copy
- Use GitHub API for branches/PRs/metadata
- Curl GitHub website if needed
Settings and Feature Flags Quick Reference
Settings Usage
const settingStore = useSettingStore()
const value = settingStore.get('Comfy.SomeSetting') // Get setting
await settingStore.set('Comfy.SomeSetting', newValue) // Update setting
Dynamic Defaults
{
id: 'Comfy.Example.Setting',
defaultValue: () => window.innerWidth < 1024 ? 'small' : 'large' // Runtime context
}
Version-Based Defaults
{
id: 'Comfy.Example.Feature',
defaultValue: 'legacy',
defaultsByInstallVersion: { '1.25.0': 'enhanced' } // Gradual rollout
}
Feature Flags
if (api.serverSupportsFeature('feature_name')) { // Check capability
// Use enhanced feature
}
const value = api.getServerFeature('config_name', defaultValue) // Get config
Documentation:
- Settings system:
docs/SETTINGS.md - Feature flags system:
docs/FEATURE_FLAGS.md
Common Pitfalls
- NEVER use
anytype - use proper TypeScript types - NEVER use
as anytype assertions - fix the underlying type issue - NEVER use
--no-verifyflag when committing - NEVER delete or disable tests to make them pass
- NEVER circumvent quality checks
- NEVER use
dark:ordark-theme:tailwind variants. Instead use a semantic value from thestyle.csstheme, e.g.bg-node-component-surface - NEVER use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil', for example:<div :class="cn('text-node-component-header-icon', hasError && 'text-danger')" />