Practical overview
When it fits
Use it when you need code for experimenting with GLCIC image completion, rather than a hosted image-editing service.
Who it is for
- Developers exploring image inpainting or adapting region-filling functionality into an image workflow.
- Machine-learning practitioners who want to run the provided inference demo or train the model on CelebA or a custom image dataset.
Documented uses
- Generate an inpainted image from a masked input using pretrained generator weights.
- Train the model using the documented CelebA dataset workflow.
- Prepare a custom dataset with training and test folders and start training.
Requirements & limits
The repository is public and specifies an MIT license.
- Inference requires the pretrained completion-network generator and configuration; the discriminator is optional for inference and needed only during training.
- The stated tested environment uses Python 3.7.6, PyTorch 1.9.0 and torchvision 0.10.0 with CUDA 11.1, plus tqdm, Pillow, OpenCV and NumPy.
- Custom training requires separate train and test folders containing JPG or PNG images.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run inference with the pretrained generator
Use the documented demo workflow to create an inpainted image from a masked input.
Before you start
- Python and the repository’s listed dependencies; its documented environment is Python 3.7.6, PyTorch 1.9.0 and torchvision 0.10.0 with CUDA 11.1.
- The pretrained completion-network generator weights and training configuration file.
- An input image.
Steps
Install the repository requirements using the README’s pip command.
Download the required pretrained generator model and configuration file.
From the repository directory, run the command below, substituting paths for the model, configuration, input and output.
python predict.py model_cn config.json images/test_2.jpg test_2_out.jpg
Expected outcome
The script writes an inpainted output image; the README illustrates raw, masked and completed image stages.
Guide limitations
- The pretrained discriminator is not required for inference; it is used during training.
- The documented pretrained models were trained on CelebA.
Prepare and train on a custom image dataset
Set up the documented input folder structure and start model training on a custom dataset.
Before you start
- The repository and its listed Python dependencies.
- A dataset containing separate
trainandtestfolders with JPG or PNG images.
Steps
Arrange the dataset as
dataset/train/anddataset/test/.Place the dataset folder under the repository’s
datasets/directory.Run the command below from the repository directory, adjusting the dataset and results paths.
python train.py datasets/dataset/ results/result/
Expected outcome
Training is started using the custom dataset, with results directed to the specified results folder.
Guide limitations
- The README documents the folder layout and training command, but not a custom-dataset inference recipe in the available instructions.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- otenim/GLCIC-PyTorch · Official homepage title · retained in its source language

