Metadata-Version: 2.1
Name: clip-interrogator
Version: 0.3.0
Summary: Generate a prompt from an image
Home-page: https://github.com/pharmapsychotic/clip-interrogator
Author: pharmapsychotic
Author-email: me@pharmapsychotic.com
License: MIT
Description: # clip-interrogator
        
        *Want to figure out what a good prompt might be to create new images like an existing one? The **CLIP Interrogator** is here to get you answers!*
        
        ## Run it!
        
        Run Version 2 on Colab, HuggingFace, and Replicate!
        
        [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pharmapsychotic/clip-interrogator/blob/main/clip_interrogator.ipynb) [![Generic badge](https://img.shields.io/badge/🤗-Open%20in%20Spaces-blue.svg)](https://huggingface.co/spaces/pharma/CLIP-Interrogator) [![Replicate](https://replicate.com/pharmapsychotic/clip-interrogator/badge)](https://replicate.com/pharmapsychotic/clip-interrogator)
        
        <br>
        
        
        Version 1 still available in Colab for comparing different CLIP models 
        
        [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pharmapsychotic/clip-interrogator/blob/v1/clip_interrogator.ipynb) 
        
        
        ## About
        
        The **CLIP Interrogator** is a prompt engineering tool that combines OpenAI's [CLIP](https://openai.com/blog/clip/) and Salesforce's [BLIP](https://blog.salesforceairesearch.com/blip-bootstrapping-language-image-pretraining/) to optimize text prompts to match a given image. Use the resulting prompts with text-to-image models like [Stable Diffusion](https://github.com/CompVis/stable-diffusion) on [DreamStudio](https://beta.dreamstudio.ai/) to create cool art!
        
        
        ## Using as a library
        
        Create and activate a Python virtual environment
        ```bash
        python3 -m venv ci_env
        source ci_env/bin/activate
        ```
        
        Install with PIP
        ```
        pip install -e git+https://github.com/pharmapsychotic/BLIP.git@lib#egg=blip
        pip install clip-interrogator
        ```
        
        You can then use it in your script
        ```python
        from PIL import Image
        from clip_interrogator import Interrogator, Config
        image = Image.open(image_path).convert('RGB')
        ci = Interrogator(Config(clip_model_name="ViT-L-14/openai"))
        print(ci.interrogate(image))
        ```
        
        CLIP Interrogator uses OpenCLIP which supports many different pretrained CLIP models. For the best prompts for 
        Stable Diffusion 1.X use `ViT-L-14/openai` for clip_model_name. For Stable Diffusion 2.0 use `ViT-H-14/laion2b_s32b_b79k`
        
        
Keywords: blip,clip,prompt-engineering,stable-diffusion,text-to-image
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Description-Content-Type: text/markdown
Provides-Extra: dev
