百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

clip-interrogator

> 开发工具
开源

使用BLIP和CLIP从图像生成提示词

3.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用BLIP和CLIP从图像生成提示词

clip-interrogator

想知道用什么好的提示词来生成与现有图片相似的新图片吗?CLIP Interrogator 可以帮你找到答案!

运行它!

现在可作为 Stable Diffusion Web UI 扩展 使用!


在 Colab、HuggingFace 和 Replicate 上运行版本 2!


版本 1 仍可在 Colab 中使用,用于比较不同的 CLIP 模型

关于

CLIP Interrogator 是一个提示词工程工具,结合了 OpenAI 的 CLIP 和 Salesforce 的 BLIP,用于优化文本提示词以匹配给定图像。将生成的提示词与文本到图像模型(如 Stable Diffusion)在 DreamStudio 上结合使用,即可创作出酷炫的艺术作品!

作为库使用

创建并激活 Python 虚拟环境

bash
python3 -m venv ci_env
(for linux  ) source ci_env/bin/activate
(for windows) .\ci_env\Scripts\activate

使用 PIP 安装

bash
# install torch with GPU support for example:
pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117

# install clip-interrogator
pip install clip-interrogator==0.5.4

# or for very latest WIP with BLIP2 support
#pip install clip-interrogator==0.6.0

然后你可以在脚本中使用它

python
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))

CLIP Interrogator 使用 OpenCLIP,它支持许多不同的预训练 CLIP 模型。为了获得最佳提示词,对于 Stable Diffusion 1.X,请使用 ViT-L-14/OpenAI 作为 clip_model_name。对于 Stable Diffusion 2.0,请使用 ViT-H-14/laion2b_s32b_b79k

配置

Config 对象允许你配置 CLIP Interrogator 的处理过程。

  • clip_model_name:使用哪个

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonclippytorch

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具