CosmicLaca / ComfyUI_Primere_Nodes

ComfyUI node pack
GNU General Public License v3.0
107 stars 13 forks source link

Error in instructions for Checkpoint Previews #16

Closed JonathanWac closed 8 months ago

JonathanWac commented 8 months ago

So I spent over an hour trying to debug why my images would not show up in the preview and I just figured it out.

I use Stability Matrix so I have previews auto generate for my models in .jpeg form, all I need to do is remove the .preview at the end and move my images over... But it still was not working.

The instructions originally told me to go here: custom_nodes\ComfyUI_Primere_Nodes\front_end\images\checkpoints

But that is incorrect. The location the previews need to go is actually here: ComfyUI\web\extensions\PrimerePreviews\images\checkpoints

To save everyone some sanity, use the "Premiere Image Preview and Save" node with the following settings so that it will auto save the file into the correct location:

image

After doing that I just did a system wide search for the name of my model and found where the file was actually located...

JonathanWac commented 8 months ago

Amazing work btw! Even though this was frustrating I still thank you for all the effort you put into this Node pack

Ainaemaet commented 8 months ago

It's a wonderful project - but allowing it to use other image formats for the previews, as well as already downloaded information is huge imo.

Porting everything over for many dozens, to hundreds of models is a big task - one which would be made much easier if other formats were accepted. I had similar issues to @JonathanWac here, but ultimately gave up as I just have so many models alongside their CivitaiBrowser+ acquired previews and info, in many multiple hierarchical subfolders.

That being said, I hope I didn't come off as entitled in my posts @CosmicLaca! - it's certainly not my intent (as I mentioned previously, I think this pack is wonderful - it's just unfortunate that one of the most useful features (for me) requires as much work as it does - when other projects out there have managed to make it compatible with what users are likely to have already available.

If you could make it do so, it would be absolutely amazing.

I'm not a python expert by any means, but should you decide to implement such a feature if you need a code grunt to help do something tedious, please let me know and I'll do my best! :)

CosmicLaca commented 8 months ago

@Ainaemaet @JonathanWac Thanks for comments! I thinking lot how to make easier or automatize the "visual" selector concept, as I see nobody like to rename/move already downloaded images. I think it is possible to read existing images from the original model/lora/etc directories, but to read and load hundreds of large png would be very slow, not same as to display only one in the menu. I will test soon what happen and how fast if I load hundreds of images from Civitai to the same modal, but the important part of my concept to read SMALL files because the loading time. If possible to solve I will do this alternative for modal loading. Now I just offer the semi-automatic preview saver node what @JonathanWac uploaded to his first comment. Just a small note, if the 'image_save_as' input set to "Save as preview" no need to set values to type, resize and quality inputs because this mode set all parameters automatically for images (220px height and 50% quality) and using only target and save_mode and selection combos.

CosmicLaca commented 8 months ago

@JonathanWac Sorry for the bad instructions on the readme. :(. This preview saver node one of my last development, and usually I push readme some days later than the node. But its true, I moved the preview path from the original location to the new '\web\extensions\PrimerePreviews\images\' folder. The readme will be corrected soon :)

CosmicLaca commented 8 months ago

@JonathanWac Readme rewritten :)

Ainaemaet commented 8 months ago

Thank you @CosmicLaca ! :) I really do appreciate all of the work you are putting in to this, and look forwards to using this in my workflows. :)

The readme was a little difficult, but I figured my way through it - my own issue was pretty well strictly limited to the .jpg hard limit, as well as the need to copy all of the files to new locations - rather than using what is already there.

Now, if you could add the ability to read and display the model info as saved as well (CB+ saves it as .html and .json, of which Pythongosssss only reads the .json) that would be truly wonderful and would provide feature-parity with similar nodes by other creators.

If you could get it to read and display the .html info saved by CB+, it would be far beyond feature parity - but whatever you feel is best! :)

I have attached an example of the .json files and .html files made by CB+, as well as an example screen of how and what Pythongosssss displays if you are interested. Please let me know if there is anything else I can do for you, aside from letting you know how frigging awesome you are. :)

Google Drive Link to HTML

realcartoonPixar_v7.json

ComfyUI_PythongosssssExample01

JonathanWac commented 8 months ago

@Ainaemaet Hey if you update your Code in Github you should actually be able to load your other images easily. I made this pull request https://github.com/CosmicLaca/ComfyUI_Primere_Nodes/pull/17 that @CosmicLaca merged yesterday. It allows the code to now recognize .png, .jpeg files as well as files that end with .preview.jpg, .preview.png, and .preview.jpeg

And if you want to add in more custom image file types you can. Just take a look at the pull request to see the files I made modifications to and you should be able to make the same modifications on your end!

Ainaemaet commented 8 months ago

@CosmicLaca, very sorry about that. The previous message was meant for you to read! I've edited to call your username as it was intended.

@JonathanWac I do thank you as well, without your post here I wouldn't have ever even thought to ask. Cheers :)

Ainaemaet commented 8 months ago

@JonathanWac Apologies, I was a bit out of it yesterday catching the tale-end of a cold and didn't see that it was your pull request lol.

Trying it as we speak, I'll let you know how it goes! :)