OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

Imagefolder

Imagefolder is a Python research repository for image-tokenization methods used in autoregressive image generation. It includes ImageFolder’s folded-token work and XQ-GAN, a flexible framework that combines quantization approaches, model backbones and training recipes.

Independent OpenViST project profile, based on linked sources.

Imagefolder — Research and experimentation with image tokenization for autoregressive models
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Imagefolder when you need research code and configurable training workflows for image tokenizers, or want to examine how tokenizer checkpoints are used in a documented VAR inference procedure.

Who it is for

  • Researchers studying discrete or visual token representations for images.
  • Developers training or fine-tuning image tokenizers for autoregressive generation.
  • Teams exploring VAR workflows that use tokenizer checkpoints.

Documented uses

  • Train or fine-tune an image tokenizer on a class-folder dataset.
  • Compare quantization configurations, including product and residual quantization.
  • Use a tokenizer checkpoint in the documented VAR inference workflow.
  • Explore latent perturbation and pFID evaluation described by the repository.
Before you choose

Requirements & limits

  • The documented setup depends on a Conda environment, PyTorch distributed training and Weights & Biases login for training.
  • Training or fine-tuning requires users to prepare datasets in a PyTorch ImageFolder-compatible class-directory structure.
  • The README supplies model checkpoints and configurations, while directing users to adjust configurations for their dataset.
  • The documented VAR inference command requires a checkpoint, ImageNet data and an external reference-batch file.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Prepare and train an image tokenizer

Set up the documented training workflow and start tokenizer training on a prepared image dataset.

Before you start

  • Python environment created from the repository's environment.yml using Conda.
  • Training and validation images arranged in class folders recognized by PyTorch ImageFolder.
  • A Weights & Biases login for the documented training workflow.

Steps

  1. Create the Conda environment with conda env create -f environment.yml.

  2. Arrange the dataset with training and validation directories containing class subfolders and images.

  3. Log in to Weights & Biases with wandb login.

  4. Edit a configuration in configs for the dataset paths and desired tokenizer settings.

  5. Start training with torchrun --nproc_per_node=8 tokenizer/tokenizer_image/xqgan_train.py --config configs/xxxx.yaml, substituting the chosen configuration file.

Expected outcome

The documented workflow reports rFID to Weights & Biases and saves the checkpoint with the best rFID on the validation set.

Guide limitations

  • The README advises modifying the checkpoint-selection metric because rFID is not closely correlated with gFID; PSNR and SSIM are noted as alternatives.
  • The configuration must be adapted for the specific dataset.
Source-based practical guide

Run the documented VAR inference workflow

Follow the repository's command-line VAR inference procedure with a tokenizer checkpoint and ImageNet reference batches.

Before you start

  • A checkpoint for the --infer_ckpt argument.
  • ImageNet data at the path supplied to --data_path.
  • The reference-batch file downloaded from the OpenAI URL specified in the README.

Steps

  1. Download VIRTUAL_imagenet256_labeled.npz from the OpenAI URL given in the README.

  2. Set the checkpoint and ImageNet paths in the documented inference command.

  3. Run the README's torchrun inference command with the selected model, token, patch and sampling parameters.

Expected outcome

The repository's VAR inference script is invoked with the specified checkpoint, ImageNet data and generation settings.

Guide limitations

  • The README provides a command template with particular model and sampling parameters; it does not describe a general-purpose inference API.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
20 November 2026
Original website title
lxa9867/ImageFolder · Official homepage title · retained in its source language