Is your feature request related to a problem? Please describe.
I didn't expect gr.State() to run deepcopy on the argument you pass to its constructor. I initially found this out from compiling a flamegraph for this extension and noticing a large spike in the constructor, where an entire Gradio component was passed to gr.State. But just the elem_id of the component was used later when it was passed to the event handler, it seems this was unintentional/unnecessary
Mikubill/sd-webui-controlnet#644
Should this be documented anywhere? And should it be necessary to deepcopy the argument in the first place?
Is your feature request related to a problem? Please describe.
I didn't expect
gr.State()to rundeepcopyon the argument you pass to its constructor. I initially found this out from compiling a flamegraph for this extension and noticing a large spike in the constructor, where an entire Gradio component was passed togr.State. But just theelem_idof the component was used later when it was passed to the event handler, it seems this was unintentional/unnecessaryMikubill/sd-webui-controlnet#644
Should this be documented anywhere? And should it be necessary to
deepcopythe argument in the first place?