ComfyUI_NAIDGenerator icon indicating copy to clipboard operation
ComfyUI_NAIDGenerator copied to clipboard

Add Support for V4.5 Inpaint with Strength and V4.5 Vibe

Open ZH79doc opened this issue 6 months ago • 27 comments

Have been using the node and it is more efficient compared to Novelai's frontend. Just want these 2 functions:

  1. The current inpaint node does not have strength parameter compared to Novelai's frontend. Could it be added? Also is the V4.5 inpaint supported?

  2. V4.5 vibe transfer just came out. If it can be added it would be extra helpful!

ZH79doc avatar Jun 28 '25 15:06 ZH79doc

I added those features and character prompts (that was already working but commented out for some reason).

I don't want to make a fork or anything so I'll just upload the updated module.

ComfyUI_NAIDGenerator.zip

The vibe transfer node needs to be put after model option node to detect v4+ mode. Also, don't use the mask convert node, it's already converted in the other nodes and doing it twice will make strange results.

Also, vibe encodings for v4+ use 2 anlas. The encodings are saved and reused, but they are unique per each different "information extracted" parameter value and mask.

tamixy avatar Jul 27 '25 16:07 tamixy

I keep getting error 500 with the vibe transfer stuff @tamixy . Is there anything outside of VibeTransfer option and load image needed for it to work?

closuretext avatar Jul 27 '25 17:07 closuretext

If you're getting the error on generate and not the vibe transfer node, it's probably because you didn't pass the model option to the vibe transfer node as I said. If the model option isn't passed, it will default to v3 vibe transfer which is incompatible.

Put the model option node first in the option transfer stack, then vibe transfer, and the rest.

If this is added properly to the extension, it might be better to put the version type as an input on the vibe transfer node instead of requiring the option. Or put the vibe extraction api requests inside the image generation node.

Also, another note, vibe encodings for v4+ use 2 anlas. The encodings are saved and reused, but they are unique per each different "information extracted" parameter value and mask.

tamixy avatar Jul 27 '25 17:07 tamixy

~~It should have been passed properly. Is this how it's done? I have anlas and opus and it works completely fine without the Vibe stuff.~~

Image

Nevermind, it needed a V4 prompt config node, I thought model selection was enough. Thanks.

closuretext avatar Jul 27 '25 17:07 closuretext

Sorry, I was just about to reply, yeah, I didn't realize the option I was using to check for v4 was from V4 prompt config. I'll update the files, that's not intended.

tamixy avatar Jul 27 '25 18:07 tamixy

Files updated in my first post.

tamixy avatar Jul 27 '25 18:07 tamixy

Thanks! I am pretty sure to original guy would appreciate a git pull for the changes.

closuretext avatar Jul 27 '25 23:07 closuretext

I give permission to diff check the files and add the changes, I just don't want to post code on github because then they block your login unless you add a phone number.

tamixy avatar Jul 28 '25 01:07 tamixy

Oh my....I already thought the node is discontinued......Greatly appreciate the help. Cannot wait to test it out!

ZH79doc avatar Jul 28 '25 03:07 ZH79doc

@tamixy Hi, yeah the new update works like a charm. Thanks again for the contribution!

A small bug I noticed:

The autosave_filename_prefix parameter in the Generate node, I notice by default it is "false,true" now. Did you want to change it to a toggle? Coz currently it is still the filename prefix and the autosave is still always active.

ZH79doc avatar Jul 28 '25 05:07 ZH79doc

I'm not getting that bug, maybe try creating a new node, it sounds like something that could happen if you load an updated node on an old workflow.

tamixy avatar Jul 28 '25 08:07 tamixy

I'm not getting that bug, maybe try creating a new node, it sounds like something that could happen if you load an updated node on an old workflow.

Add a new generate node and they parameter is just "NAI_autosave". I guess it is just not a toggle.

Anyway thanks!

ZH79doc avatar Jul 28 '25 09:07 ZH79doc

Another question on one of the new node, the V4 base prompt node:

What does the node do? It looks just like a text box to me, the output is just text string. Is it the same just as text box or it has some specific use? The character caption can be connected to other NAID Option that is intuitive.

ZH79doc avatar Jul 28 '25 18:07 ZH79doc

I have no idea, I didn't make it. Looking at the code it just transfers the input to the output untouched. Comments on the code suggest it used to do something but was removed.

tamixy avatar Jul 28 '25 19:07 tamixy

Thanks for the reply. Ah then maybe just an abandoned one, no wonder why I did not notice it earlier....

ZH79doc avatar Jul 29 '25 03:07 ZH79doc

@tamixy Hi, just want to follow up a bit for the update, which has been splendid. Just wonder: I saw there is a "normalize reference strength" button in Novelai's web but in the node I did not see such thing. Is it normalize them by default, or it need to be implemented seperately?

ZH79doc avatar Jul 31 '25 17:07 ZH79doc

Dunno, there's nothing about it in the api docs. Maybe it adjusts the vibe strengths client-side by reading the vibe info values.

On another similar note, I've seen that the image gen api has a couple of controlnet parameters, does anyone know anything about that? It's separate from director tools, is it a removed old feature, or possibly something upcoming?

tamixy avatar Aug 01 '25 12:08 tamixy

Yeah I saw the controlnet thing as well. I think they used to have something like that:

https://blog.novelai.net/novelai-controlnet-tools-upscaling-new-image-generation-ui-8e3c2b174acb

But it is no longer there anymore I guess

ZH79doc avatar Aug 01 '25 12:08 ZH79doc

@tamixy Thanks so much for your amazing work, the code runs smoothly!

I just have one question: I’m not sure if this is a bug, but when generating two or more characters, the local outputs look different from the online generations, even though I imported the exact same metadata. Or maybe I linked the nodes incorrectly?

For reference, my character node setup is: v4 character caption 1 → v4 character caption 2 → network option → model option → Generate

Thanks in advance for the help!

FoxZzz avatar Aug 16 '25 03:08 FoxZzz

@FoxZzz I don't know, if you have character coordinates on the website, that needs to be turned on in the V4 prompt config node.

tamixy avatar Aug 16 '25 17:08 tamixy

Not sure if this is the right thread for it, but do you have any plans on adding support for Character Reference too? Would be really helpful! https://blog.novelai.net/preview-release-novelai-character-reference-for-consistent-characters-dc882be996c7

BlueSchneider avatar Sep 12 '25 09:09 BlueSchneider

I’m not too familiar with GitHub issues, so I’m not sure if @tamixy noticed your comment. It might be worth tagging directly here.

FoxZzz avatar Sep 16 '25 06:09 FoxZzz

I opened a separate ticket about Character Reference. There are a few requirements such as the resolution size of each image. I'm not really a coder, but I was able to gather this info from looking at API calls when generating on official NovelAI. It may not be straightforward to implement because it asks for an image of a larger resolution than what you're generating (if you're at the standard sizes).

Heather95 avatar Sep 16 '25 17:09 Heather95

Updated extension with character reference.

ComfyUI_NAIDGenerator_char_ref_update.zip

Image resizing functionality is taken from KJnodes.

Image output on the character reference node is just for previewing, only the option is needed. It can be inserted at any position among other nai option nodes.

tamixy avatar Sep 16 '25 23:09 tamixy

Updated extension with character reference.

ComfyUI_NAIDGenerator_char_ref_update.zip

Image resizing functionality is taken from KJnodes.

Image output on the character reference node is just for previewing, only the option is needed. It can be inserted at any position among other nai option nodes.

Downloading this and overwriting my install of the custom node with it broke it.

danganbenpa avatar Sep 17 '25 17:09 danganbenpa

Updated extension with character reference. ComfyUI_NAIDGenerator_char_ref_update.zip Image resizing functionality is taken from KJnodes. Image output on the character reference node is just for previewing, only the option is needed. It can be inserted at any position among other nai option nodes.

Downloading this and overwriting my install of the custom node with it broke it.

What's the error?

tamixy avatar Sep 17 '25 21:09 tamixy

Updated extension with character reference. ComfyUI_NAIDGenerator_char_ref_update.zip Image resizing functionality is taken from KJnodes. Image output on the character reference node is just for previewing, only the option is needed. It can be inserted at any position among other nai option nodes.

Downloading this and overwriting my install of the custom node with it broke it.

What's the error?

It's okay. It's my bad for not reading through the replies here. It was definitely the order my nodes were in. Rearranging them fixed it.

danganbenpa avatar Sep 19 '25 09:09 danganbenpa