huchenlei / sd-webui-openpose-editor

Openpose editor for ControlNet. Full hand/face support.
MIT License
637 stars 64 forks source link

[Feature Request] Add Redo/Undo feature #22

Open huchenlei opened 1 year ago

huchenlei commented 1 year ago

The redo/undo should cover most UI interactions that affects outputs:

The redo/undo should not cover:

Maybe we should also display a event ring to help users understand what would happen if undo is pressed.

huchenlei commented 1 year ago

Progress Update: Here is how another openpose editor does for undo/redo feature. It captures the state of canvas at each undoable event (move for them), and directly set the canvas state back. https://github.com/fkunn1326/openpose-editor/blob/722bca6fb9b062815d13b950e7040589abaec797/javascript/main.js#L91

This has some problems in here, not only because we have more operations to support, but also because we have a control panel that is not 100% determined by canvas state, i.e. if we remove all canvas objects and re-add objects with same data to the canvas, the link between canvas objects to the controlpanel objects will be broken.

It will not be simple to implement a redo/undo feature, but not impossible. I will be thinking more on a good design that fits here.