code: def cmdargs(line):
      args = shlex.split(line)
      pos = 0
      res = {}
  
      while pos < len(args):
          arg = args[pos]
  
          assert arg.startswith("--"), f'must start with "--": {arg}'
          assert pos + 1 < len(
              args
          ), f"missing argument for command line option {arg}"
  
          tag = arg[2:]
  
          if tag == "prompt" or tag == "negative_prompt":
              pos += 1
              prompt = args[pos]
              pos += 1
              while pos < len(args) and not args[pos].startswith("--"):
                  prompt += " "
                  prompt += args[pos]
                  pos += 1
              res[tag] = prompt
              continue
  
          func = prompt_tags.get(tag, None)
          assert func, f"unknown commandline option: {arg}"
  
          val = args[pos + 1]
          if tag == "sampler_name":
              val = sd_samplers.samplers_map.get(val.lower(), None)
  
          res[tag] = func(val)
  
          pos += 2
  
      return res
  
imports: import copy
  import random
  import shlex
  import modules.scripts
  import gradio
  from modules import sd_samplers, errors, sd_models
  from modules.processing import Processed, process_images
  from modules.shared import state
label_desc: Use image node_id 6 for calling a global function with example usage: cmdargs(line) and returns: res