Skip to content

Document gr.State() deepcopying its argument #3558

Description

@space-nuko
  • I have searched to see if a similar issue already exists.

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs/websiteRelated to documentation or website

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions