pharmapsychotic / clip-interrogator

Image to prompt with BLIP and CLIP
MIT License
2.59k stars 428 forks source link

[Request] Implementation into Automatic1111 WebUI? #44

Open Woisek opened 1 year ago

Woisek commented 1 year ago

In the title. Is there a simple solution how this can be implemented as extension or so? Would be awesome.

pharmapsychotic commented 1 year ago

Could you give this a try? https://github.com/pharmapsychotic/clip-interrogator-ext It's installing and working for me but didn't work for a friend who tried it. If you get any errors in the terminal can you paste them here?

Woisek commented 1 year ago

Could you give this a try? https://github.com/pharmapsychotic/clip-interrogator-ext It's installing and working for me but didn't work for a friend who tried it. If you get any errors in the terminal can you paste them here?

Thanks for this repo. Unfortunately there is indeed an error coming up: `Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Closing server running on port: 7860 Restarting UI... Error loading script: clip_interrogator_ext.py Traceback (most recent call last): File "I:\Super SD 2.0\stable-diffusion-webui\modules\scripts.py", line 229, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "I:\Super SD 2.0\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "I:\Super SD 2.0\stable-diffusion-webui\extensions\clip-interrogator-ext\scripts\clip_interrogator_ext.py", line 3, in import clip_interrogator ModuleNotFoundError: No module named 'clip_interrogator'`

Thanks for your effort!

Woisek commented 1 year ago

Any chance to get this working in Automatic1111 WebUI ... please ?

vcsab05 commented 1 year ago

I simply paste this line in windows cmd after I install the extension, and it works for me: pip install clip-interrogator==0.4.4

(I don't know what I'm doing but hope it helps :) )

zif2016 commented 1 year ago

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 1326: illegal multibyte sequence

Maxadox commented 1 year ago

I'm getting an error as well, running on a M1 Macbook, can anyone help? thanks:

Loading weights [cc6cb27103] from /Users/machado/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt Applying cross attention optimization (InvokeAI). Weights loaded in 4.2s (load weights from disk: 1.8s, apply weights to model: 1.5s, move model to device: 0.9s). Loading CLIP Interrogator 0.5.4... Loading BLIP model... load checkpoint from https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_large_caption.pth Loading CLIP model... Loaded CLIP model and data in 4.45 seconds. 2023-03-16 08:14:00.107 Python[5788:25819958] Error getting visible function: (null) Function floorOp_i64 was not found in the library /AppleInternal/Library/BuildRoots/5b8a32f9-5db2-11ed-8aeb-7ef33c48bc85/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Utility/MPSKernelDAG.mm:803: failed assertion `Error getting visible function: (null) Function floorOp_i64 was not found in the library' zsh: abort ./webui.sh machado@Felipes-MBP stable-diffusion-webui % /opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' machado@Felipes-MBP stable-diffusion-webui % x

Tigwin commented 1 year ago

I installed from url with https://github.com/pharmapsychotic/clip-interrogator-ext, and ran the "pip install clip-interrogator==0.4.4" command

The UI initially was unresponsive and didn't do anything. I changed through the tabs a few times, ended up hitting reload on my browser and tried again. Second time through it started to download a bunch of files. So maybe it just needed time to start up or something.

Loading CLIP Interrogator 0.5.4... load checkpoint from D:\stable-diffusion\stable-diffusion-webui\models\BLIP\model_base_caption_capfilt_large.pth Loading CLIP model... ViT-L-14_openai_artists.safetensors: 100%|████████████████████████████████████████| 16.2M/16.2M [00:00<00:00, 51.1MB/s] ViT-L-14_openai_flavors.safetensors: 100%|██████████████████████████████████████████| 155M/155M [00:02<00:00, 54.8MB/s] ViT-L-14_openai_mediums.safetensors: 100%|██████████████████████████████████████████| 146k/146k [00:00<00:00, 6.95MB/s] ViT-L-14_openai_movements.safetensors: 100%|████████████████████████████████████████| 307k/307k [00:00<00:00, 9.91MB/s] ViT-L-14_openai_trendings.safetensors: 100%|████████████████████████████████████████| 111k/111k [00:00<00:00, 5.83MB/s] ViT-L-14_openai_negative.safetensors: 100%|███████████████████████████████████████| 63.2k/63.2k [00:00<00:00, 5.26MB/s] Loaded CLIP model and data in 12.94 seconds. 100%|███████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 211.35it/s] Flavor chain: 31%|█████████████████████▎ | 10/32 [00:09<00:21, 1.04it/s] 100%|███████████████████████████████████████████████████████████████████████████████| 110/110 [00:00<00:00, 256.18it/s] 100%|█████████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 186.27it/s] 100%|█████████████████████████████████████████████████████████████████████████████████| 99/99 [00:00<00:00, 223.28it/s]

But it's working with just the two commands executed.

Tigwin commented 1 year ago

I ran it on a photo of myself and...

a close up of a person wearing a suit and tie, with nerdy! glasses! and goatee, steven jung, professional headshot, in 2 0 1 8, young cute wan asian face, nick silva, without mustache, tally hall, smiling like a jerk, official government photo, age 3 0, precisionism

damn, robot threw me some shade.