File System Tutorial : A Comprehensive Guide to ComfyUI File System

This tutorial explains the ComfyUI file structure in plain English, with clear definitions of each folder/file and how they work . It’s tailored for new users who want to organize models, custom nodes, and outputs without confusion.

1. Core Concept: How ComfyUI Uses Files

ComfyUI is a node-based Stable Diffusion tool that relies on a well-organized file system to load models, store outputs, and run custom features. All files are stored in the main ComfyUI folder (the folder you get after downloading/extracting ComfyUI).

The file system follows two simple rules:

  • ComfyUI automatically scans specific folders for models/nodes (you don’t need to manually link most files).
  • You only need to place files in the correct subfolders—no complex configuration required for basic use.

2. Full ComfyUI File Structure (Top-Down View)

Here’s the standard folder layout for Windows (macOS/Linux is almost identical, with minor differences like no .exe files).


ComfyUI/
├── models/                  # Core: All AI models (checkpoints, LoRAs, VAEs, etc.)
    ├── checkpoints/
    ├── diffusion_models/
    ├── unet/
    ├── vae/
    ├── loras/
    ├── text_encoders/
    ......
├── custom_nodes/            # Extensions: Installed custom nodes (extra features)
├── outputs/                 # Storage: Generated images, logs, and metadata
├── config/                  # Settings: Configuration files for ComfyUI
├── main.py                  # Launch script (run this if not using .exe)
├── ComfyUI.exe              # Windows one-click launcher (for prebuilt versions)
├── requirements.txt         # Dependencies list (for manual installation)
└── web/                     # Internal: Frontend files (don’t edit unless you know how)

3. Detailed Explanation of Key Folders

3.1 models/ – The "Brain" of ComfyUI

This is the most important folder—it stores all AI models that power image generation. ComfyUI scans subfolders here automatically, so models will show up in the node menu once placed correctly.

Never rename the subfolders (e.g., don’t change checkpoints to models)—ComfyUI won’t recognize them otherwise.

Subfolder NameWhat to Put HereKey Notes
checkpoints/Stable Diffusion main models (e.g., v1-5-pruned-emaonly.safetensors, Flux1-dev.safetensors)These are full models for generating images; include clip and VAE in the model. But now is rarely used.
diffusion_models/Diffusion models (e.g., z-image-turbo)Used for image generation; not include clip or VAE.
unet/UNet models (e.g., unet-ft-mse-840000-ema-pruned.safetensors)Used for image generation; some checkpoints include UNet (no need to add separately)
vae/Variational Autoencoders (e.g., vae-ft-mse-840000-ema-pruned.safetensors)Improves image color/quality; some checkpoints include VAE (no need to add separately)
loras/LoRA models (smaller models for style/character tweaks, e.g., anime_style_lora.safetensors)Lightweight (few MBs to 1GB); use with a Apply LoRA node
embeddings/Textual inversions/embeddings (e.g., easynegative.safetensors, bad_prompt_version2.pt)Used for positive/negative prompts; rarely use
controlnet/ControlNet models (e.g., control_sd15_canny.pth)Controls image composition (pose, depth, edges); needs a ControlNet node
upscale_models/Upscalers (e.g., 4x_foolhardy_Remacri.pth, ESRGAN_x4plus.pth)Enlarges images without losing quality; use with Upscale Image node

Pro Tip: Create subfolders inside these (e.g., models/loras/anime/, models/checkpoints/flux/) to organize models by type/style—ComfyUI will still detect them. like subgraph-image

important notes:

  • If the model is put in the checkpoints folder, it approbably have UNet and VAE in the model.Especially for some old models like sdxl.
  • If the model is put in the diffusion_models folder, it approbably not include UNet or VAE.
  • divide models into diffusion models ,vae and unet models, just want them to have a better result.

3.2 custom_nodes/ – Add Extra Features.

This folder holds custom nodes—extensions that add new functions to ComfyUI (e.g., new samplers, image processors, or integration with other tools like IP-Adapter).

How It Works:

  1. When you download a custom node (usually a ZIP file or Git repo), extract/copy it into custom_nodes/.
  2. Restart ComfyUI—the new nodes will appear in the node menu (use the search bar to find them).

Example Folder Structure:


custom_nodes/
├── ComfyUI-IP-Adapter/      # IP-Adapter node (for image-to-image guidance)
├── ComfyUI-Custom-Samplers/ # New sampling methods
└── ComfyUI-Image-Utils/     # Image editing tools (crop, resize, etc.)

Important Notes:

  • Some custom nodes need extra dependencies (listed in their README.md). Install them via pip install [dependency-name] in the ComfyUI folder.
  • If a node doesn’t load, check for errors in the ComfyUI console (most issues are missing dependencies or incompatible ComfyUI versions).

3.3 outputs/ – Store Your Creations

This folder saves all generated images and their metadata (prompt, settings, seed, etc.). ComfyUI creates subfolders automatically to keep things organized.

Default Subfolders:

SubfolderContent
outputs/img2img/Images generated with the img2img workflow
outputs/txt2img/Images generated with the txt2img workflow
outputs/extras/Images from other workflows (e.g., upscaling, inpainting)
outputs/logs/Log files with generation details (useful for debugging)

Key Features:

  • Each image is named with a timestamp (e.g., ComfyUI_00012_202601261530.png) to avoid overwriting.
  • Metadata is embedded in the image file—you can view it with tools like ExifTool or ComfyUI’s built-in image viewer.

3.4 config/ – Tweak ComfyUI Settings

This folder contains configuration files to customize ComfyUI’s behavior. For beginners, the only file you might need to edit is config.py.

Common Edits in config.py:

  • Change the default output folder: Modify output_directory = "outputs" to a new path (e.g., "D:/ComfyUI-Outputs").
  • Enable/disable CUDA acceleration: Ensure cuda = True (for GPU usage—critical for fast generation).
  • Adjust image quality settings: Tweak parameters like default_sample_format or png_compression_level.

Warning: Don’t edit other files (e.g., model_management.py) unless you understand Python and ComfyUI’s code—incorrect changes can break the tool.

3.5 Other less Important Files

File NamePurpose
main.pyThe main Python script to launch ComfyUI (use this if you installed via Git instead of the prebuilt .exe). Run with python main.py in the terminal.
ComfyUI.exeWindows one-click launcher (only in prebuilt ComfyUI packages). Double-click to start ComfyUI without a terminal.
requirements.txtList of Python dependencies (e.g., torch, diffusers, numpy). Install them with pip install -r requirements.txt if you get "module not found" errors.

4. Best Practices for File Management

Follow these rules to keep your ComfyUI file system clean and avoid issues:

  1. Organize models by category: Create subfolders in models/ (e.g., models/checkpoints/flux/, models/loras/realistic/)—it makes finding models faster.
  2. Delete unused files: Regularly clean outputs/ to save disk space (old images/logs can take up GBs).
  3. Backup custom nodes: If you have many custom nodes, copy the custom_nodes/ folder to a backup drive—reinstalling ComfyUI won’t delete it, but accidents happen.
  4. Use safetensors instead of ckpt: safetensors files are safer (no malware risk) and load faster than ckpt files—always prefer them.
  5. Don’t rename core folders: Never change the name of models/, custom_nodes/, or outputs/—ComfyUI relies on these exact names.

5. Common Troubleshooting for File Issues

ProblemCauseFix
Models don’t show up in ComfyUIPlaced in the wrong subfolder (e.g., LoRA in checkpoints/).Move the model to the correct subfolder (e.g., models/loras/) and restart ComfyUI.
Custom nodes don’t loadMissing dependencies or incompatible node version.Check the node’s README.md for required packages; install them via pip. Update ComfyUI to the latest version.
Images aren’t savingNo write permission for the outputs/ folder (Windows/macOS security settings).Run ComfyUI as Administrator (Windows) or change folder permissions (right-click → Properties → Security).
ComfyUI crashes on launchCorrupted model file or insufficient GPU memory.Delete the corrupted model (check console for error messages about which model is causing the crash). Close other apps to free up GPU memory.