Acly / krita-ai-diffusion

Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required.
https://www.interstice.cloud
GNU General Public License v3.0
6.96k stars 342 forks source link

[Suggestion] Clip Selector or at least change the way clips are loaded #1324

Closed derdelush closed 3 weeks ago

derdelush commented 3 weeks ago

I had installed PulID to play around with it and the Krita plugin started failing due to it loading the EVA02_CLIP used by that, after I removed it from the directory, it kept looking for it.

Acly commented 3 weeks ago

It looks for clip_l, clip_g and t5 if needed, that is all. I don't really understand what you did, what the error was, or what PulID/EVA02_CLIP have to do with anything?

derdelush commented 3 weeks ago

That's what I saw also but then for some reason if I have the EVA_02 in the clips directory it goes after it even after renaming and the plugin stops working giving me either this "AttributeError: 'NoneType' object has no attribute 'device'". Or if I remove it from the directory before restarting Krita this:

`To see the GUI go to: http://127.0.0.1:8188
got prompt
Failed to validate prompt for output 14:
* DualCLIPLoaderGGUF 2:
  - Value not in list: clip_name1: 'ZZ_EVA02_CLIP_L_336_psz14_s6B.pt' not in ['clip_l.safetensors', 't5-v1_1-xxl-encoder-Q8_0.gguf', 't5xxl_fp16.safetensors', 't5xxl_fp8_e4m3fn.safetensors']
Output will be ignored
invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}
['flux-lora-collection\\anime_lora_comfy_converted.safetensors', 'flux-lora-collection\\art_lora_comfy_converted.safetensors', 'flux-lora-collection\\disney_lora_comfy_converted.safetensors', 'flux-lora-collection\\mjv6_lora_comfy_converted.safetensors', 'flux-lora-collection\\realism_lora_comfy_converted.safetensors', 'flux-lora-collection\\scenery_lora_comfy_converted.safetensors']
['flux-lora-collection\\anime_lora_comfy_converted.safetensors', 'flux-lora-collection\\art_lora_comfy_converted.safetensors', 'flux-lora-collection\\disney_lora_comfy_converted.safetensors', 'flux-lora-collection\\mjv6_lora_comfy_converted.safetensors', 'flux-lora-collection\\realism_lora_comfy_converted.safetensors', 'flux-lora-collection\\scenery_lora_comfy_converted.safetensors']
got prompt
Using pytorch attention in VAE
Using pytorch attention in VAE
model weight dtype torch.float8_e4m3fn, manual cast: torch.bfloat16
model_type FLUX
D:\Software\ComfyUI\custom_nodes\ComfyUI-GGUF\nodes.py:79: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_numpy.cpp:212.)
  torch_tensor = torch.from_numpy(tensor.data) # mmap`

Even renaming it didn't work. I can send the entire plugin log file if that helps explain it.

Acly commented 3 weeks ago

Ok that makes sense, it has clip_l in its name. The substring matching isn't very robust, but it mostly works, and there aren't great alternatives.

As a way to disambiguate, you can move the file you want the plugin to use in a krita subfolder. Those will be preferred.

derdelush commented 3 weeks ago

That sounds good will do that for the plugin so I don't mix it up with the other experiments. Thank you!