Timothy LovettKerin Lovett
Published © MIT

Reflective Diffusion

Magic mirror enclosed screen renders with help from SDXL diffusion and an esp32s3 for sending photos and recorded sound for prompting

IntermediateFull instructions provided16 hours339
Reflective Diffusion

Things used in this project

Hardware components

NVIDIA Jetson AGX Orin Developer Kit
Running stable diffusion via ComfyUI, whisper, and acting as the API
×1
Mirror Acrylic
×1
18x24 Shadow Box
×1
Amazon Basics 24" Monitor
×1
Grove - Piezo Buzzer
Seeed Studio Grove - Piezo Buzzer
×1
Grove Button
×1
Grove Shield for Seeeduino XIAO - with embedded battery management chip
Seeed Studio Grove Shield for Seeeduino XIAO - with embedded battery management chip
×1
Webcam, Logitech® HD Pro
Webcam, Logitech® HD Pro
×1
Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1

Software apps and online services

ComfyUI

Story

Read more

Code

ComfyUI - Demo Workflow

JSON
{
  "3": {
    "inputs": {
      "seed": 574565069423886,
      "steps": 2,
      "cfg": 1,
      "sampler_name": "ddim",
      "scheduler": "sgm_uniform",
      "denoise": 1,
      "model": [
        "46",
        0
      ],
      "positive": [
        "14",
        0
      ],
      "negative": [
        "14",
        1
      ],
      "latent_image": [
        "62",
        0
      ]
    },
    "class_type": "KSampler",
    "_meta": {
      "title": "KSampler"
    }
  },
  "8": {
    "inputs": {
      "samples": [
        "3",
        0
      ],
      "vae": [
        "43",
        2
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "VAE Decode"
    }
  },
  "14": {
    "inputs": {
      "strength": 0.35,
      "start_percent": 0,
      "end_percent": 0.35,
      "positive": [
        "37",
        0
      ],
      "negative": [
        "39",
        0
      ],
      "control_net": [
        "15",
        0
      ],
      "vae": [
        "43",
        2
      ],
      "image": [
        "31",
        0
      ]
    },
    "class_type": "ControlNetApplySD3",
    "_meta": {
      "title": "Apply Controlnet with VAE"
    }
  },
  "15": {
    "inputs": {
      "control_net_name": "sdxl-controlnet-all.safetensors"
    },
    "class_type": "ControlNetLoader",
    "_meta": {
      "title": "Load ControlNet Model"
    }
  },
  "31": {
    "inputs": {
      "ckpt_name": "depth_anything_v2_vits.pth",
      "resolution": 448,
      "image": [
        "59",
        0
      ]
    },
    "class_type": "DepthAnythingV2Preprocessor",
    "_meta": {
      "title": "Depth Anything V2 - Relative"
    }
  },
  "33": {
    "inputs": {
      "image": ""
    },
    "class_type": "ETN_LoadImageBase64",
    "_meta": {
      "title": "Load Image (Base64)"
    }
  },
  "34": {
    "inputs": {
      "format": "PNG",
      "images": [
        "8",
        0
      ]
    },
    "class_type": "ETN_SendImageWebSocket",
    "_meta": {
      "title": "Send Image (WebSocket)"
    }
  },
  "35": {
    "inputs": {
      "format": "PNG",
      "images": [
        "31",
        0
      ]
    },
    "class_type": "ETN_SendImageWebSocket",
    "_meta": {
      "title": "Send Image (WebSocket)"
    }
  },
  "37": {
    "inputs": {
      "text": "dog in dragon rainbow cave",
      "clip": [
        "43",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "39": {
    "inputs": {
      "text": "text, watermark",
      "clip": [
        "43",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "42": {
    "inputs": {
      "image": "20250121_120100.jpg"
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "Load Image"
    }
  },
  "43": {
    "inputs": {
      "ckpt_name": "sd_xl_base_1.0.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "Load Checkpoint"
    }
  },
  "45": {
    "inputs": {
      "images": [
        "31",
        0
      ]
    },
    "class_type": "PreviewImage",
    "_meta": {
      "title": "Preview Image"
    }
  },
  "46": {
    "inputs": {
      "lora_name": "Hyper-SDXL-2steps-lora.safetensors",
      "strength_model": 1,
      "model": [
        "43",
        0
      ]
    },
    "class_type": "LoraLoaderModelOnly",
    "_meta": {
      "title": "LoraLoaderModelOnly"
    }
  },
  "48": {
    "inputs": {
      "channel": "red",
      "image": [
        "31",
        0
      ]
    },
    "class_type": "ImageToMask",
    "_meta": {
      "title": "Convert Image to Mask"
    }
  },
  "49": {
    "inputs": {
      "mask": [
        "70",
        0
      ]
    },
    "class_type": "InvertMask",
    "_meta": {
      "title": "InvertMask"
    }
  },
  "54": {
    "inputs": {
      "mask": [
        "49",
        0
      ]
    },
    "class_type": "MaskToImage",
    "_meta": {
      "title": "Convert Mask to Image"
    }
  },
  "55": {
    "inputs": {
      "images": [
        "54",
        0
      ]
    },
    "class_type": "PreviewImage",
    "_meta": {
      "title": "Preview Image"
    }
  },
  "59": {
    "inputs": {
      "target_width": 1080,
      "target_height": 1080,
      "padding_color": "black",
      "interpolation": "lanczos",
      "image": [
        "42",
        0
      ]
    },
    "class_type": "ResizeAndPadImage",
    "_meta": {
      "title": "ResizeAndPadImage"
    }
  },
  "60": {
    "inputs": {
      "pixels": [
        "59",
        0
      ],
      "vae": [
        "43",
        2
      ]
    },
    "class_type": "VAEEncode",
    "_meta": {
      "title": "VAE Encode"
    }
  },
  "62": {
    "inputs": {
      "samples": [
        "60",
        0
      ],
      "mask": [
        "49",
        0
      ]
    },
    "class_type": "SetLatentNoiseMask",
    "_meta": {
      "title": "Set Latent Noise Mask"
    }
  },
  "66": {
    "inputs": {
      "images": [
        "8",
        0
      ]
    },
    "class_type": "PreviewImage",
    "_meta": {
      "title": "Preview Image"
    }
  },
  "69": {
    "inputs": {
      "expand": -8,
      "tapered_corners": true,
      "mask": [
        "71",
        0
      ]
    },
    "class_type": "GrowMask",
    "_meta": {
      "title": "GrowMask"
    }
  },
  "70": {
    "inputs": {
      "left": 8,
      "top": 8,
      "right": 8,
      "bottom": 8,
      "mask": [
        "69",
        0
      ]
    },
    "class_type": "FeatherMask",
    "_meta": {
      "title": "FeatherMask"
    }
  },
  "71": {
    "inputs": {
      "value": 0.5,
      "mask": [
        "48",
        0
      ]
    },
    "class_type": "ThresholdMask",
    "_meta": {
      "title": "ThresholdMask"
    }
  }
}

Interactive Mirror

Credits

Timothy Lovett
22 projects • 19 followers
Maker. I spent over a decade working on backend systems in various languages.
Kerin Lovett
3 projects • 3 followers

Comments