Skip to content

reverse-engineers images, faithfully reproducing prompts with precision

Notifications You must be signed in to change notification settings

mbukeRepo/pixel-forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixel-forge (WIP)

Looking for a good question to create new images similar to an existing one? Use PixelForge.

Usage

Install all dependencies:

   pip install -r requirements.txt

You can now use it in your script.

from PIL import Image
from pixel_forge import PixelForge, Config

clip_model_name = "ViT-L-14/openai"
image_path = "your image path"
image = Image.open(image_path).convert("RGB")
px = PixelForge(Config(clip_model_name=clip_model_name))
print(px.interrogate(image)) # best image prompt 

Configuration

The Config object lets you configure CLIP Interrogator's processing.

  • clip_model_name: which of the OpenCLIP pretrained CLIP models to use
  • cache_path: path where to save precomputed text embeddings
  • download_cache: when True will download the precomputed embeddings from huggingface
  • chunk_size: batch size for CLIP, use smaller for lower VRAM

About

reverse-engineers images, faithfully reproducing prompts with precision

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages