class_docstr: allows saving and restoring default values for gradio components
class_docstr_tok: ["allows","saving","and","restoring","default","values","for","gradio","components"]
docstr: given a dictionary with defaults from a file and current values from gradio elements, returns
  an iterator over tuples of values that are not the same between the file and the current;
  tuple contents are: path, old value, new value
docstr_tok: ["given","a","dictionary","with","defaults","from","a","file","and","current","values","from","gradio","elements",",","returns","an","iterator","over","tuples","of","values","that","are","not","the","same","between","the","file","and","the","current",";","tuple","contents","are",":","path",",","old","value",",","new","value"]
code: def iter_changes(self, current_ui_settings, values):
      """
      given a dictionary with defaults from a file and current values from gradio elements, returns
      an iterator over tuples of values that are not the same between the file and the current;
      tuple contents are: path, old value, new value
      """
  
      for (path, component), new_value in zip(
          self.component_mapping.items(), values
      ):
          old_value = current_ui_settings.get(path)
  
          choices = radio_choices(component)
          if isinstance(new_value, int) and choices:
              if new_value >= len(choices):
                  continue
  
              new_value = choices[new_value]
              if isinstance(new_value, tuple):
                  new_value = new_value[0]
  
          if new_value == old_value:
              continue
  
          if old_value is None and new_value == "" or new_value == []:
              continue
  
          yield path, old_value, new_value
  
file_path: stable-diffusion-webui/modules/ui_loadsave.py
imports: import json
  import os
  import gradio
  from modules import errors
  from modules.ui_components import ToolButton, InputAccordion
label_desc: Use image node_id 7 for calling the UiLoadsave obj's underlying member method code with example usage: obj.iter_changes(current_ui_settings, values) without return types