DeFLOCNet
sketch- and color-guided image inpainting
2 min readupdated
DeFLOCNet handles image inpainting (filling in and restoring missing or masked-out regions) at a 256 × 256 resolution. Unlike standard mask-only filling, the model lets you guide contours with a sketch and specify target hues using color strokes. KumaPower's repository provides two checkpoints built on the sd_color_v2 architecture—one for close-up portraits and another for everyday scenes. The tool works well for targeted retouching, editing facial details, and refining compositions on small images.
Key features
- Two specialized weights:
deflocnet-hdtf-step10000.ptis trained on HDTF face crops (10,000 steps), whiledeflocnet-general-step23500.ptis trained on a mixed dataset of Places2, Unsplash, T2I, and HDTF (23,500 steps). - Triple guidance: The canvas combines a white mask (the generation region), black sketch lines, and sparse color hints.
- Original pixel preservation: Pixels outside the white mask are copied directly from the 256 × 256 source image.
- Inference-ready: The files are FP32 PyTorch generator checkpoints ready to run locally.
What you can do
- Retouch and edit portraits: Use the portrait checkpoint with face auto-framing to redraw features or close-up details along custom contours.
- Edit landscapes and architecture: Apply the general checkpoint to replace objects in building and nature photos while controlling the silhouette and palette.
- Compare results in the studio: Test both checkpoints on the same image, mask, and seed in the DeFLOCNet Studio web demo before integrating locally.
Example
Upload an image to DeFLOCNet Studio, pick Auto-frame portrait (to automatically crop a single face) or Use full image (for general scenes and pre-cropped portraits), paint a white mask over the target area, and add a black sketch with color strokes—the model generates the missing region and blends it with the untouched source pixels.
Read more
DetailsArchitecture:
sd_color_v2 (the DeFLOCNet method was originally presented at CVPR 2021).Format and resolution: FP32 generator checkpoints, fixed 256 × 256 input and output size.
Training: 10,000 steps (HDTF portrait) and 23,500 steps (General scenes).
Instructions for running locally via the command line are available in the author's GitHub repository.










Comments