deepfakes/faceswap · error · FaceswapError

The Timelapse path '{folder}' does not contain any valid ima

Error message

The Timelapse path '{folder}' does not contain any valid images

What it means

Raised when a timelapse input folder exists but contains no .png files (case-insensitive extension check on os.listdir). Faceswap takes the first PNG in each timelapse folder as the sample image for the timelapse video, so an empty/non-PNG folder aborts training startup.

Source

Thrown at scripts/train.py:181

                                "(--timelapse-input-A, --timelapse-input-B and "
                                "--timelapse-output).")

        timelapse_folders = [self._args.timelapse_input_a, self._args.timelapse_input_b]
        get_folder(self._args.timelapse_output)

        for idx, folder in enumerate(timelapse_folders):
            side = "a" if idx == 0 else "b"
            if folder is not None and not os.path.isdir(folder):
                raise FaceswapError(f"The Timelapse path '{folder}' does not exist")

            training_folder = getattr(self._args, f"input_{side}")
            if folder == training_folder:
                continue  # Time-lapse folder is training folder

            filenames = [os.path.join(folder, fname) for fname in os.listdir(folder)
                         if os.path.splitext(fname)[-1].lower() == ".png"]
            if not filenames:
                raise FaceswapError(f"The Timelapse path '{folder}' does not contain any valid "
                                    "images")

            self._validate_faceswap_image(filenames[0])
        logger.debug("[Train] Timelapse enabled")
        return True

    def process(self) -> None:
        """The entry point for triggering the Training Process.

        Should only be called from  :class:`lib.cli.launcher.ScriptExecutor`
        """
        if self._args.summary:
            self._load_model()
            return
        logger.debug("[Train] Starting Training Process")
        logger.info("Training data directory: %s", self._args.model_dir)
        thread = self._start_thread()
        # from lib.queue_manager import queue_manager; queue_manager.debug_monitor(1)

View on GitHub (pinned to f530cb7508)

Solutions

  1. Put at least one Faceswap-extracted PNG face into each timelapse input folder.
  2. If your faces are JPEGs, re-run extract with PNG output or point the flag at the PNG extract output.
  3. Alternatively set the timelapse input to the same path as the corresponding training input folder, which is skipped by design.

Example fix

# before: tl_a/ contains only preview.jpg
ls tl_a/  # preview.jpg

# after
python scripts/extract.py -i a_frames/ -o tl_a/   # writes PNG faces with metadata
ls tl_a/  # face_00001.png
Defensive patterns

Strategy: validation

Validate before calling

import os

def folder_has_png(folder: str) -> bool:
    return any(os.path.splitext(f)[-1].lower() == ".png" for f in os.listdir(folder))

Prevention

When it happens

Trigger: Training with timelapse enabled where the timelapse input folder exists but holds only .jpg/.jpeg files, empty files, subfolders, or is empty — and the folder is not identical to the training input folder (which would be skipped).

Common situations: Timelapse folder freshly created but not yet populated; pointing at a folder of JPEG previews; extract output written to a different folder than the one passed to --timelapse-input-*.

Related errors


AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15). Data as JSON: /api/errors/985968697bb45b3e. Report an issue: GitHub.