code: def run():
      st.title("Stable Diffusion Upscaling")
      # run via streamlit run scripts/demo/depth2img.py <path-tp-config> <path-to-ckpt>
      sampler = initialize_model(sys.argv[1], sys.argv[2])
  
      image = st.file_uploader("Image", ["jpg", "png"])
      if image:
          image = Image.open(image)
          w, h = image.size
          st.text(f"loaded input image of size ({w}, {h})")
          width, height = map(
              lambda x: x - x % 64, (w, h)
          )  # resize to integer multiple of 64
          image = image.resize((width, height))
          st.text(
              f"resized input image to size ({width}, {height} (w, h))"
          )
          st.image(image)
  
          st.write(
              f"\n Tip: Add a description of the object that should be upscaled, e.g.: 'a professional photograph of a cat'"
          )
          prompt = st.text_input(
              "Prompt", "a high quality professional photograph"
          )
  
          seed = st.number_input(
              "Seed", min_value=0, max_value=1000000, value=0
          )
          num_samples = st.number_input(
              "Number of Samples", min_value=1, max_value=64, value=1
          )
          scale = st.slider(
              "Scale",
              min_value=0.1,
              max_value=30.0,
              value=9.0,
              step=0.1,
          )
          steps = st.slider(
              "DDIM Steps", min_value=2, max_value=250, value=50, step=1
          )
          eta = st.sidebar.number_input(
              "eta (DDIM)", value=0.0, min_value=0.0, max_value=1.0
          )
  
          noise_level = None
          if isinstance(sampler.model, LatentUpscaleDiffusion):
              # TODO: make this work for all models
              noise_level = st.sidebar.number_input(
                  "Noise Augmentation",
                  min_value=0,
                  max_value=350,
                  value=20,
              )
              noise_level = (
                  torch.Tensor(num_samples * [noise_level])
                  .to(sampler.model.device)
                  .long()
              )
  
          t_progress = st.progress(0)
  
          def t_callback(t):
              t_progress.progress(min((t + 1) / steps, 1.0))
  
          sampler.make_schedule(steps, ddim_eta=eta, verbose=True)
          if st.button("Sample"):
              result = paint(
                  sampler=sampler,
                  image=image,
                  prompt=prompt,
                  seed=seed,
                  scale=scale,
                  h=height,
                  w=width,
                  steps=steps,
                  num_samples=num_samples,
                  callback=t_callback,
                  noise_level=noise_level,
                  eta=eta,
              )
              st.write("Result")
              for image in result:
                  st.image(image, output_format="PNG")
  
file_path: StableDiffusion/scripts/streamlit/superresolution.py
imports: import sys
  import torch
  import numpy
  import streamlit
  from PIL import Image
  from omegaconf import OmegaConf
  from einops import repeat, rearrange
  from pytorch_lightning import seed_everything
  from imwatermark import WatermarkEncoder
  from scripts.txt2img import put_watermark
  from ldm.models.diffusion.ddim import DDIMSampler
  from ldm.models.diffusion.ddpm import LatentUpscaleDiffusion, LatentUpscaleFinetuneDiffusion
  from ldm.util import exists, instantiate_from_config
label_desc: Use image node_id 5 for calling a global function with example usage: run() without return types