CLIP blending and concatenation #8266
catboxanon
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Hi, looks very interesting but having trouble enabling it. The script is running as I see the options on my X/Y/Z scripts but I'm having trouble making it work. I think it's becuase I don't know what information to put in. I'm attaching a screenshot and maybe you can tell me where I'm going wrong. It's probably very obvious but any help would be appreciated. Thank you. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Based on some findings from an anon on 4chan, for models trained primarily with the penultimate CLIP layer, there seems to be a benefit to blending (and optionally concatenating) a combination of the final and penultimate CLIP layers in order to bring back higher-level, detailed concepts from the final layer, while retaining the quality of the penultimate layer the model was trained with. In the own words of anon:
This is not necessarily based on analytical evidence and only trial and error, but the results were interesting enough I collaborated with this anon and made a script to implement this, with additional x/y plot support. The change is small enough it's feasible to distribute as a standalone script for now to drop in the
scripts
directory, but I believe it could also be cloned to theextensions
directory if you like.This is a normal x/y plot for the last layer and penultimate layer of CLIP, as it is in the webui currently:
Full size w/ PNG info
And this is an x/y plot utilizing the script, using several blend ratios, as well as an option for concatenating an additional CLIP layer blend.
Full size w/ PNG info (47mb!)
(Note that for the left-hand chart, you may only focus on the first row, as all others are the same, because CLIP concatenation is disabled for that chart)
These examples are fairly basic and you'll need to write your own prompts to investigate the results for yourself to get a feel for the difference. I've personally found for the default blend defined in the script as-is with concatenation enabled, you can get some very interesting results sometimes compared to having neither enabled. The results for the upper rows of the right-hand chart are also of note for very different results from normal CLIP behavior.
Because this is currently still WIP, saving generation params to PNG info hasn't been implemented yet.
You can find the script here: https://gist.github.com/catboxanon/bdcf23a2699c920da0d8177dbfa34e15
Note that the filename is important for x/y plot support, as the webui parses scripts in alphabetical order, and is unable to add custom x/y axis options if this script is parsed before the xyz grid script.
Beta Was this translation helpful? Give feedback.
All reactions