pharmapsychotic / clip-interrogator

Image to prompt with BLIP and CLIP
MIT License
2.71k stars 431 forks source link

About Independent Use #78

Closed Ading163 closed 1 year ago

Ading163 commented 1 year ago

I want to deploy this feature locally and not embed it in SD. What should I do? Is there a document for reference

pharmapsychotic commented 1 year ago

Yes checkout the REAME for instructions on installing and calling from your own scripts:

pip install clip-interrogator==0.5.4

from PIL import Image
from clip_interrogator import Config, Interrogator
image = Image.open(image_path).convert('RGB')
ci = Interrogator(Config(clip_model_name="ViT-L-14/openai"))
print(ci.interrogate(image))
pharmapsychotic commented 1 year ago

Or you can clone the repo, install requirements, then run python run_gradio.py to run it