volotat / SD-CN-Animation

This script allows to automate video stylization task using StableDiffusion and ControlNet.
MIT License
806 stars 61 forks source link

PURPIFY is definitely a feature, not a bug! #94

Open peteTater opened 1 year ago

peteTater commented 1 year ago

Hi firstly thank you, I absolutely love what you're developing here. It's become my favourite animation tool to work with. Having endless fun on this project and I'm getting stunning results!

Can I please request that if possible, the colour matching techniques previously used prior to commit 83 also remain present in the extension as an additional option for users to select? I humbly offer my own working title "Purpify" for this early stage Feature (definitely not a bug).

The prior tendency of frames to travel towards a purple hue, as discussed in these issues that you've closed a couple hours ago https://github.com/volotat/SD-CN-Animation/issues/57 and in https://github.com/volotat/SD-CN-Animation/issues/67, was completely integral to my workflow on the project I'm in the middle of, so I am currently attempting to rollback to a version prior to commit 83 from yesterday. I'm still uncertain which exact commit version last "featured" the slide towards purple.

The fluidity and evolution of the generated frames was perfect for the prompts/models I've been working with, as the colour drift brought other quite distinctive evolutions in the animation which don't seem to occur in the newer versions of the extension. Presently the colour regulates, however the animation also seems to be impacted by this and has less capacity for evolutionary variation over time.

There also seems to be an observable stuttering, it happens with a regular frequency that can be easier noticed in longer sequences, and a visual reset of sorts now occurs along with it, which creates a less dynamic shot. As a result, it does now almost come close to being loopable, which might be benficial in certain situations.

I ran a 2040 frame sequence overnight after this change to colour matching to get a clearer picture of how the animation now evolves over an extended period of time, and the animation has become far more repetitive. It seens to have lost much of it's dynamic capacity to develop/mutate visually while having the beautiful fluid coherence it still offered when working with your prior commits. The entire aesthetic has changed, and so I'd be extremely grateful if you'd consider this not a closed bug, but recognise it as an absolutely magnificent feature that could be further explored and developed upon.

Just for example, if the drift in to purple is anything to go by, the added ability to manually set a multistage hue shift of variable intensity between frame X and Y and then set another between frame Y and Z etc before rendering the sequence would create new forms of evolutionary effects over time from the same static prompt. I was planning to make such a hue variation feature request before observing that one person's bug is another person's untapped feature!

Thanks so much, and hope you consider (re)implementing Purpify, and potentially further hue drift enhancements to this already mindblowing extension!

volotat commented 1 year ago

I got you. Huge thanks for the feedback. I'm gonna work today on expanding txt2vid options and I'm definitely gonna add a color matching control option. Regarding hue control feature, I don't think this is necessary as you can easily emulate this effect by making a color drifting video and using it as a control video with 'tile' control net. It should create the same effect, although the color matching option that is set right now might interfere, but it should work fine after the update with new options.

peteTater commented 1 year ago

Awesome thanks for that suggestion, I haven't touched the other tab as of yet so I'll try that out and see how it effects the generated sequence, and hopefully I can figure out how to get the purpified version reinstalled. I'm kicking myself that I don't have an exact version number for the extension I've been using. Didn't realise how much the 'purpifying' effect was impacting the directional visual flow of the sequences until the extension was updated yesterday. I haven't had to rollback an extension yet, so now have to learn how to do that as well as figure out which commit I was using! Thanks again for creating this and really looking forward to seeing how txt2vid develops.

volotat commented 1 year ago

@peteTater I think this commit should work for you to restore your workflow a35f446b698221e2b561dcdd6c5b27c68c6cb6f6

peteTater commented 1 year ago

Thanks, I saw the version you linked was commit 99, so had misunderstood and thought that the prior colour management was already now restored as an option in the most recent commit. Appears I'll still need to go rummaging through previous commits to locate whichever version I had prior to the changes I think occured yesterday around commit 83. I tried to copy the URL you provided in to the "Install from URL" tab under the Extensions tab and it threw an error. I don't really know what I'm doing yet on the rollback front as it's my first time trying to do it and I'm still searching for the relevant information on the process.

I checked for updates on the Installed tab instead and then updated the extension. The version I presently have installed continues to regulate the colour and animation.

I've done a quick test with this version anyway, and can report that on generating a 120 frame sequence that I've previously run (I'm aware it's never the same twice), I'm seeing the same tendency towards maintaining a more stable shot and colour over the course of the sequence. What I'm also noticing, is that the initial image generated seems oversaturated, in contrast with the original seed image generated with the prior version I had been using, and as the sequence develops the features of the characters are less cohesive and have an overall more mangled appearance. I'll of course have to test more extensively with a broader range of prior sequences to get a better picture but that's what I'm observing so far.

On the Installed tab I am now seeing version "e16p7285 (Sun May 14 14:25:17 2023)" is installed. I see Main is now at commit 100. Did I get the right version when I installed the update?

volotat commented 1 year ago

"e16p7285" is the latest version with the last commit. You need to go just one comment below, this is the version I gave in the link. To revert it, go to SD-CN-Animation extension folder and run this command in the console: git checkout a35f446

peteTater commented 1 year ago

The console says "HEAD is now at a35f446 Issue #92 fix" and on the Installed tab the URL and Version field are empty, so I'm assuming that all went as planned. If all I have to do is use "git checkout" with the relevant commit hash to revert then hopefully I can set up a dedicated install of A1111 to use the right commit with that separate install to finish off the project.

There was previously a tendency in many sequences I generated, for characters to flow predominantly to the right and then shrink off in to the lower corner. I had found ways to put that quality to great use. The motions occured in undulating swells and the characters would often morph into other objects or new versions of themselves, but throughout their features tending to remain recogniseable and largely stable. The characteristic flow was very distinctly observeable over many sequences, and for my own use, this was perfect. I'm now seeing a tendency for the subjects to shrink away from the camera, flowing backwards, rather than mostly off to the right or left.

After seeing the absence of the purple drift yesterday, I had put this down to the colour shift over time being the source of the evolution in the sequence. For all I know however, it's something else, or several things other than and including colour management that's impacting the changes I'm now observing. I don't know if you've perhaps also made changes to optical flow or some other component under the hood might be the cause or a contributing factor, so for now I'll pray I can revert the extension for use in my project specific setup. I'm going to try the hue shift video input method you suggested earlier as a starting point to test the idea that it was solely a quality of the purple drift.

I've only had the chance to re-run another shorter frame sequence with commit 99/a35f446 and it appears I am getting slightly more visual range from the prompt with 99 than on the other recent commits I've been testing, so not quite as repetitive, however faces are overall quite scrappy looking in a higher number of frames. Haven't had time to run more sequences so I can't tell yet if there's any noticeable frequency to it. It may only be an issue with my model and prompt as well, so will need to test more to really know what the pros/cons are in the update.

Will be happy to keep providing feedback as this tool grows, I absolutely love it, I'm getting high quality work done in a matter of days that would have been hard to imagine accomplishing before its release. Thanks for the tip on how to revert, hopefully that's all I need to know to get it working as before to finish off my current project!

peteTater commented 1 year ago

I tried all of the hashes from May 11th through the 13th, and unfortunately couldn't reproduce the previous colour matching heuristics induced aesthetic. Some of the versions I couldn't get to load at all or without throwing errors, possibly the specific version I'm searching for is hiding amongst the ones that wouldn't work for me.

Through this process I discovered that each of the commits have subtly or quite distinctly different optical flow directional tendencies when generating the same prompt/seed sequence. Of the versions I worked my way through (which had the frame output toggle implemented), there was only one version that produced a similar colour shift, but was a much more oversaturated reddish and didn't benefit from the same fluidity, character feature consistency, or direction of motion.

I don't know if you're planning to implement more txt2img param controls at some stage for optical flow in particular, but for now I'm cycling between multiple versions of your extension to achieve different motion effects for each sequence. It's a shame my other project had to be brought to a halt in order to make this discovery but the results in many situations are excellent and it introduces a lot of variety to the sequences.