Detextify is a Python library designed to remove unwanted pseudo-text from images generated by generative AI models such as Stable Diffusion, Midjourney, and DALL·E. Generative visual models sometimes produce artifacts such as random text in images, and Detextify makes images text-free through a pipeline of text detection, masking, and in-painting.
Main capabilities:
- Text detection: supports local Tesseract or the Azure Computer Vision API.
- In-painting: supports local Stable Diffusion (via the Huggingface diffusers library, requires a GPU and CUDA/cuDNN) or APIs (OpenAI DALL·E 2 or Replicate Stable Diffusion v2).
- Extensible: provides multiple detection and in-painting implementations, and users can also add custom implementations.
Usage:
- Installation: requires installing Tesseract (for local text detection) or preparing Azure resources; local in-painting requires a GPU.
- Basic usage: a few lines of code can remove text from an image.
- Batch processing: PNG images in a directory can be processed in a loop.
- Examples: a Colab notebook and detailed instructions are provided.
Use cases:
- Clean up pseudo-text in AI-generated images to improve image quality.
- For downstream applications that need to control generated output and reduce unwanted effects.
Limitations:
- Local in-painting requires a GPU and CUDA/cuDNN.
- Using the APIs requires the corresponding keys and resources.
- Specific results and performance are not provided in the material.