#Metadata-Linked (now part or core as of invoke 5.7)

110 messages · Page 1 of 1 (latest)

willow tendon
#

** These nodes have been adopted into core as of invoke 5.7.
I suggest just deleting the metadata-linked-nodes folder and use core insted.
The repo will remain as a source of examples and documentation.**

A set of nodes for Metadata. Collect Metadata from within an iterate node & extract metadata from an image.

  • Metadata Item Linked - Allows collecting of metadata while within an iterate node with no need for a collect node or conversion to metadata node.
  • Metadata From Image - Provides Metadata from an image.
  • Metadata To String - Extracts a String value of a label from metadata.
  • Metadata To Integer - Extracts an Integer value of a label from metadata.
  • Metadata To Float - Extracts a Float value of a label from metadata.
  • Metadata To Scheduler - Extracts a Scheduler value of a label from metadata.
  • Metadata To Bool - Extracts Bool types from metadata
  • Metadata To Model - Extracts model types from metadata
  • Metadata To SDXL Model - Extracts SDXL model types from metadata
  • Metadata To LoRAs - Extracts Loras from metadata.
  • Metadata To SDXL LoRAs - Extracts SDXL Loras from metadata
  • Metadata To ControlNets - Extracts ControNets from metadata
  • Metadata To IP-Adapters - Extracts IP-Adapters from metadata
  • Metadata To T2I-Adapters - Extracts T2I-Adapters from metadata
  • Denoise Latents + Metadata - This is an inherited version of the existing Denoise Latents node but with a metadata input and output.
  • Flux Denoise + Metadata - Same as above

See repo for instruction on how to install
Repo: metadata-linked-nodes

https://github.com/skunkworxdark/metadata-linked-nodes/blob/main/images/workflow-metadata_linked.png
https://github.com/skunkworxdark/metadata-linked-nodes/blob/main/images/workflow-image_to_metadata.png

GitHub

Metadata nodes for InvokeAI. Contribute to skunkworxdark/metadata-linked-nodes development by creating an account on GitHub.

GitHub

Metadata nodes for InvokeAI. Contribute to skunkworxdark/metadata-linked-nodes development by creating an account on GitHub.

GitHub

Metadata nodes for InvokeAI. Contribute to skunkworxdark/metadata-linked-nodes development by creating an account on GitHub.

willow tendon
#

Release History:
27 Feb 25 - All nodes adopted into core invoke as of V5.7

29 Jan 25

  • added a custom label to the Metadata to LoRA Collection node. Now you can pull and store lora data under any metadata label name.

23 Jan 25

  • Added flux specific built in metadata names guideance, cfg_scale_start_step & cfg_scale_end_step
  • Added Automatic recording of flux specific metadata to FluxDenoise node - cfg_scal, cfg_scale_start_step & cfg_scale_end_step
  • new node Metadata To LoRA Collection - Creates a Lora Collection from metadata that can be fed into the Lora Collection Loader nodes.

28 Sep 24 - invoke 5.0 Flux update. Added Flux Denoise + metadata node. (auto collects model, seed, width, height, steps, guidance, denoise_start, denoise_end and lora metadata.

  • The previous release is available under the repo tag of invoke-4.2.9

02 Jul 24 - fix to the model identification from metadata. New versions of metadata_to_loras and metadata_to_sdlx_loras

28 Jun 24

  • Minor fix for DenoiseLatentsInvocation import path introduced with Invoke 4.2.5
  • New tag to reference Invoke 4.2.4 compatible version

9 May 24 - Updated to use invocation_api - no functional changes

2 Apr 24 - 4.0 Update
The main branch has been updated to be InvokeAi 4.0 compatible and the 4.0-test branch removed. Run the update.bat/update.sh in the node folder to get the latest version.

If you require the 3.7 or older compatible version then there are tags on the repo at the appropriate points that can be used. See the readme in the repo for further details.
26 Feb 24 - Bug fix to Metadata To Model & Metadata To SDXL Model + Revised workflow examples

see repo for full history

21 Dec '23 - First Release

willow tendon
#

TODO:

  • additional flux metadata when added to invoke, VAE, T5 ~Encoder, Clip, Controlnets, ip-adapters etc...
willow tendon
#

reserved

willow tendon
#

The Release is now available from the Repo

naive dust
#

I appear to having issues with Metadata to Model. After genning with Denoise+Meta trying to pull the model data back out I get an error

  File "C:\StableDiffusion\invokeai3\.venv\lib\site-packages\invokeai\app\services\invocation_processor\invocation_processor_default.py", line 134, in __process
    outputs = invocation.invoke_internal(
  File "C:\StableDiffusion\invokeai3\.venv\lib\site-packages\invokeai\app\invocations\baseinvocation.py", line 669, in invoke_internal
    output = self.invoke(context)
  File "C:\StableDiffusion\invokeai3\nodes\metadata-linked-nodes\metadata_linked.py", line 383, in invoke
    model = MainModelField.model_validate_json(
  File "C:\StableDiffusion\invokeai3\.venv\lib\site-packages\pydantic\main.py", line 538, in model_validate_json
    return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
pydantic_core._pydantic_core.ValidationError: 1 validation error for MainModelField
  JSON input should be string, bytes or bytearray [type=json_type, input_value={'model_name': 'doomerBoo...in', 'submodel': 'unet'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/json_type

[2024-02-16 20:43:30,862]::[InvokeAI]::ERROR --> Error while invoking:
1 validation error for MainModelField
  JSON input should be string, bytes or bytearray [type=json_type, input_value={'model_name': 'doomerBoo...in', 'submodel': 'unet'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/json_type```
#

There's also a way to put a separate VAE in to the metadata but no way to pull one out.

willow tendon
#

could you share an image of how you have setup your nodes?

naive dust
willow tendon
#

ok I have reproduced. I will take a look at this

willow tendon
naive dust
#

Would love to see a Metadata to VAE node.

willow tendon
#

np to be fair that bit was obviously untested 🙂

naive dust
#

Well it's tested now.

#

Real handy for a simple upscale workflow. Just loras missing, really

willow tendon
willow tendon
willow tendon
naive dust
willow tendon
naive dust
willow tendon
#

controlnet/adapters probably could be done a bit like my linked adapters nodes.

naive dust
#

Ah, I see.

willow tendon
#

However, even with the cleared intermediates issues it is still probably worth having a go at doing them. So on my todo list is: Metadata To Loras, Metadata To Controlnets, Metadata To IP-Adapters, Metadata To T2I-Adapter 😄

naive dust
#

They'd be wonderful, though I think I'd only really get use out of the LoRAs. If I was doing CNs or IPAs that'd be a special case which wouldn't be too much of a pain to handle manually.

willow tendon
#

I was also thinking that I should have a version of the Metadata to Model that outputs the Unet, Clip and VAE like the existing Main Model nodes does then you don't need the overloaded one from the XYGrid nodes

naive dust
#

Is there any use for the full Model output type besides plugging it in to the Core Metadata node?

willow tendon
#

yes if you want to feed into an XYGrid

naive dust
#

I haven't tried it.

willow tendon
#

XYGrids are great for comparing different settings. However, model switching can make it slow especially if they are SDXL models

naive dust
#

I just slap some text on images with the composition nodes and throw them in PureRef, I find it easier than panning around one large image.

willow tendon
#

not seen pureref

naive dust
#

Just an minimalist image viewing board I use for 3D modelling reference but I find it handy for use with AI art stuff too.

naive dust
#

Got a chance to play some more and found a little issue in the Metadata to VAE node.
Firstly it will fail with a type error if the VAE metadata is "Default", meaning the node's Default Value dropdown never gets used. This will happen if the image is genned in the t2i tab (while it's set to Default VAE) or with Denoise+meta and no separate VAE is specified using a Metadata Item.
In my use-case, I just want it to use the VAE that's specified in the metadata so perhaps the node should take a "fallback" VAE as an input, instead of the Default Value dropdown. The user can then plug in the main model's baked VAE. If a separate one is specified it will output that, if not it just outputs the fallback.

willow tendon
#

New Release:

  • Added Metadata to Loras, Metadata To SDXL LoRAs.
  • Added unet, clip and vae outputs to Metadata To Model & Metadata To SDXL Model
  • Added default vae as an input to Metadata to VAE
willow tendon
#

Still on the todo list Metadata To Controlnets, Metadata To IP-Adapters, Metadata To T2I-Adapter left to

naive dust
# willow tendon Done and a few other things. let me know what you think.

All seems to work fantastically but I did notice that it's odd is that the Denoise+Meta adds a VAE field when that's not part of it's inputs (and it's always Default no matter what you're actually using) and it doesn't add Clip Skip when it seems like, if LoRAs are in it's metadata output, then Clip Skip should be too if it's possible.
Otherwise fantastic work. Huge QoL improvement.

willow tendon
#

the vae is pulled from the internal variables within denoise. so if one isn't provided then it comes from the model.

#

I guess I could check if the model name is the same as the main model and omit it but I don't know if the adds anything useful

willow tendon
naive dust
#

Mostly just the anime models using it, I think but you need it set right to get the expected output of models and LoRAs trained with it.

willow tendon
#

I guess at the moment the clip skip could be captured manually. and re-applied via the clip skip node. It looks like the front end only supports clip skip on the 1.5 models

naive dust
willow tendon
#

From what I can see it's not obvious where I could get the clip skip from within the denoise node as it's not specifically passed to it as far as I can see and this happens mostly in the compel node. Also, in nodes you have lots of flexibility of when you would apply clip skip before or after Loras and which clip model etc. from what I can see it's not really a global thing like it is shown in the frontend ui

naive dust
#

I don't believe it going before or after LoRAs matters, it still seems to apply correctly but that's purely anecdotal. It's hardly a big issue, though. Thanks for looking in to it.

willow tendon
#

np. I might look into it a little more after I have looked at the controlnets and adapters

naive dust
#

Oh yea. I'm sure they will be much more desired.

willow tendon
#

I feel like the metadata nodes will be in a fairly good place after I have added them

naive dust
#

Feels like they're in a great place right now but with CNs and Adapters it'll be the whole package.

willow tendon
#

I was thinking of adding a lattents to image + metadata to capture the last couple of fields automatically but I don't think it is worth the effort.

naive dust
#

Ah that makes some sense, I suppose.

#

No, I wouldn't say so. I just used a couple of Metadata Linked nodes at the end to add the few things that Denoise+Meta doesn't grab like ClipSkip. I've got a bit of a node soup going in some places but I'm not sure if that's an issue you should address here or if it's more of a lack of tools in the workflow editor to mitigate that such as groups or reroutes.

willow tendon
#

mine are a spaghetti mess also 🙂

naive dust
#

I was thinking about it for some more beginner t2i/upscale stuff but I'll have to pull out the other community nodes first.

willow tendon
#

you should have seen some of the XYGrid Tiled upscaling workflows 🙂

#

right need to go spend some time with the family. 😄

naive dust
#

Great work! ❤️

willow tendon
#

New Release: 22nd Feb 2024 - Add New nodes

  • Metadata To ControlNets - Extracts ControNets from metadata
  • Metadata To IP-Adapters - Extracts IP-Adapters from metadata
  • Metadata To T2I-Adapters - Extracts T2I-Adapters from metadata

These nodes have been tested but should be considered as needing more testing for the moment.

Note: Generations will fail if the images that the ControlNet, IP-Adapter or T2I-Apater uses don't exist. As some of the inputs to these can be intermediates then as a user you might not even know that they have been removed.

tired vigil
#

Hi, just installed your @willow tendon work and loaded the json "Metadata from Image". All works, can load the image, but it seems to demand a SD 1.5/2 model to be used (XL models are not recognized. I'm using Invoke 3.7). Am I doing something wrong or have I misread the XL readout and it is not supported?

willow tendon
#

@tired vigil When you say load the JSON. Do you mean loaded one of the workflows? If so they are a little old now and are only there as a guide of how the nodes could be used. If you want to use that first workflow with sdxl then you would need to change to main model loader and the prompts to sdxl versions. Creating new workflow examples is sontjing that is on my to-do list.

tired vigil
willow tendon
tired vigil
#

The reason I installed it to begin with was the misconception of Invoke AI being unable to load the meta data of saved images (at least there generated). Turns out that a few examples just had none, cause of how I saved them.
Long story short, I wonder what I'd use it for, now that this has been resolved.

willow tendon
willow tendon
#

New Release - 26 Feb 2024

  • Bug fix to Metadata To Model & Metadata To SDXL Model for when no metadata is found.
  • Metadata To VAE - label default_vae changed to default_value to match all other nodes
  • Revised workflow examples and readme
tired vigil
balmy orbit
#

is there a way to save the positive and negative prompts as well? (models, seed, steps etc. work just fine from "denoise with metadata").

willow tendon
willow tendon
tired vigil
# willow tendon I am not sure I understand what you mean by "node-based metadata viewer". The n...

Yes, but all it does is giving a node to upload an image and splitting the meta data output in their respective categories/nodes, right?
Uploading an image made (and correctly) saved with Invoke does the same, as in putting all the info into their textfields/adjusting values etc.

At least to me, latter seems preferable. Using the node approach would only be better when analyzing non-Invoke (native) gens, or am I misunderstanding how it works?

willow tendon
#

yes, that is true if you are only working with one image at a time. but if you then use it with some other kind of node, like images from board. then you can loop over all the images in a board and modify the metadata and regenerate all the image. maybe with a different model or sampler or prompt etc.

balmy orbit
tired vigil
balmy orbit
willow tendon
willow tendon
#

update to 4.0-test branch for some type changes to main + some addition update for typing

willow tendon
#

update to 4.0-test branch for some more type changes to main

willow tendon
#

further update to 4.0-test branch for some more type changes to main

willow tendon
#

2nd Apr 2024 - 4.0 Update
The main branch has been updated to be InvokeAi 4.0 compatible and the 4.0-test branch removed. Run the update.bat/update.sh in the node folder to get the latest version.

If you require the 3.7 or older compatible version then there are tags on the repo at the appropriate points that can be used. See the readme in the repo for further details.

#

Metadata-Linked & Metadata From Image Nodes [4.0+]

willow tendon
#

9th May 24

  • Updated to use invocation_api - no functional changes
willow tendon
#

28 Jun 24

  • Minor fix for DenoiseLatentsInvocation import path introduced with Invoke 4.2.5
  • New github tag invoke-4.2.4 to reference Invoke 4.2.4 compatible version
naive dust
#

Trying to recreate my 1.5 upscale method with these for XL and I'm getting an error with Metadata to SDXL Model.

[2024-07-02 01:08:02,375]::[InvokeAI]::ERROR --> Traceback (most recent call last):
  File "C:\StableDiffusion\invokeai\.venv\lib\site-packages\invokeai\app\services\session_processor\session_processor_default.py", line 129, in run_node
    output = invocation.invoke_internal(context=context, services=self._services)
  File "C:\StableDiffusion\invokeai\.venv\lib\site-packages\invokeai\app\invocations\baseinvocation.py", line 289, in invoke_internal
    output = self.invoke(context)
  File "C:\StableDiffusion\invokeai\nodes\metadata-linked-nodes\metadata_linked.py", line 819, in invoke
    model = get_model(model_key, context)
  File "C:\StableDiffusion\invokeai\nodes\metadata-linked-nodes\metadata_linked.py", line 215, in get_model
    raise Exception(f"Unknown model: {model_key}")
Exception: Unknown model:```
willow tendon
#

could you share a workflow and image that causes this error

willow tendon
naive dust
willow tendon
# naive dust Images I was testing with were only just generated in t2i so LoRAs are all there...

the error you supplied indicates it couldn't find the LoRA from the metadata. So instead used a LoRA called "" instead. I should just skip over a lora if it is not found and not try use one called "" (doh). I will fix this soon but I would like to confirm that this is the error you got or if something else happened. So the image with the metadata intact would be useful to track this down.

naive dust
#

I'm on it now, no problem.

willow tendon
willow tendon
#

02 Jul 24 - There is a new version with a fix to the model identification. It will now try load the model via the model key in the metadata then if that fails it will try using the model name. New versions of metadata_to_loras and metadata_to_sdlx_loras however this change will also effects any model loading done by the nodes

#

@naive dust new version in the repo should fix your issues

naive dust
naive dust
willow tendon
naive dust
willow tendon
#

it was added on the main branch a couple of days back so I guess it will be in a full release in the not too distant future.

naive dust
#

That'll be great. It was really useful in that Breadboard image management app until it was abandoned.

willow tendon
#

New Release available :

28 Sep 24 - invoke 5.0 Flux update. Added Flux Denoise + metadata node. (auto collects model, seed, width, height, steps, guidance, denoise_start, denoise_end and lora metadata.

willow tendon
#

New Release available:

23 Jan 25

  • Added flux specific built in metadata names guideance, cfg_scale_start_step & cfg_scale_end_step
  • Added Automatic recording of flux specific metadata to FluxDenoise node - cfg_scal, cfg_scale_start_step & cfg_scale_end_step
  • new node Metadata To LoRA Collection - Creates a Lora Collection from metadata that can be fed into the Lora Collection Loader nodes.

Warning if no LoRA metadata is available then this will cause an error in the Lora Collection Load nodes. There is a PR in the main InvokeAI to fix this. https://github.com/invoke-ai/InvokeAI/pull/7579

GitHub

Update the LoRA Collection Loader nodes to make the Lora Collection input Optional
Summary
LoRACollectionLoader, SDXLLoRACollectionLoader & FLUXLoRACollectionLoader changed to make the LoRA...

willow tendon
#

29 Jan 25

  • added a custom label to the Metadata to LoRA Collection node. Now you can pull and store lora data under any metadata label name.
willow tendon
#

Metadata-Linked (now part or core as of invoke 5.7)