olegchomp / TDDiffusionAPI

TouchDesigner interface for AUTOMATIC1111
170 stars 6 forks source link

Result output TOP not updating within the same frame if on a paused timeline #6

Closed aulerius closed 1 year ago

aulerius commented 1 year ago

Hello!

I am currently trying to create a custom timeline based image sequence rendering using your implementation.

I'm running in non realtime, paused timeline mode. A chain of nodes forms a pipeline of inputs and outputs, including a feedback loop. It advances the timeline frame by frame based on finished frames. I rely on the "imageReady" output to advance the stream of processing after the SD is done, however I notice the output TOP is not actually updating the image on the same frame, but only the next frame. Is this intended? It is rather unintuitive to me and I've been stuck troubleshooting my setup, because I didn't realize this introduces an unwanted blank (or previously rendered) frame in the feedback loop.

I can probably work around this, but a desired behavior would be to have "imageReady" work in sync with an actual new image being present in the TOP outputs, even on the same frame and if its paused. Force cooking the TDD component after having the image ready doesn't help.

Thank you! Hope this makes sense.

aulerius commented 1 year ago

For the time being I achieved the behavior by force cooking the TOP that receives the image from api like this: op(f'script{scriptop+1}').cook(force=True) adding it at the end of script_image function. This updates the image downstream even when timeline is paused.

Maybe you have a more streamlined approach though.

olegchomp commented 1 year ago

There is noise top in component exactly for that (I think). You can set any parameter of noise to your timeline just for cooking chain.