How ming053l/flashrefocus works
FlashReFocus is an interactive image-refocusing system: prepare an image by restoring it and estimating depth, then produce edits by changing the focus/depth conditions and rendering. Its documented capabilities include focal-plane, aperture, tilt-shift and mask edits, video spotlight, and ComfyUI integration; training code is also present. The graph emphasizes inference and its user-facing routes. Source excerpts and the SOURCE INDEX support the main inference links; some video and training relationships are documented or indexed rather than shown in excerpts.
Main entry points: pipeline.py Refocuser pipeline · video.py Video spotlight · nodes.py ComfyUI nodes · renderer.py Bokeh renderer
Components 19
Refocus inference
- Refocuser pipeline
flashrefocus/pipeline.py - Image I/O
flashrefocus/image_io.py - Image restoration
flashrefocus/deblurring/deblurrer.py - One-step diffusion
flashrefocus/deblurring/one_step_diffusion.py - Decoder refiner
flashrefocus/deblurring/decoder_refiner.py - Depth estimation
flashrefocus/rendering/depth.py - Bokeh renderer
flashrefocus/rendering/renderer.py - Defocus attention
flashrefocus/rendering/defocus_bias_attention.py
Focus editing
- Depth edits
flashrefocus/rendering/depth_edits.py - Mask segmentation
flashrefocus/segment.py - Video spotlight
flashrefocus/video.py - Video overlays
flashrefocus/overlays.py
User interfaces
- Refocus CLI
scripts/refocus.py - ComfyUI nodes
comfyui/nodes.py
Model training
- Restoration data
training/deblurring_data.py - Restoration training
training/train_deblurring.py - Renderer data
training/rendering_data.py - Renderer training
training/train_renderer.py
Other components
- User
Connections 21
- User → Refocus CLI: runs
- Refocus CLI → Refocuser pipeline: invokes
scripts/refocus.py - Refocuser pipeline → Image I/O: reads and saves
flashrefocus/pipeline.py - Refocuser pipeline → Image restoration: restores with
flashrefocus/pipeline.py - Refocuser pipeline → Depth estimation: estimates depth
flashrefocus/pipeline.py - Refocuser pipeline → Depth edits: samples focus
flashrefocus/pipeline.py - Refocuser pipeline → Bokeh renderer: renders edits
flashrefocus/pipeline.py - Image restoration → One-step diffusion: predicts latent
flashrefocus/deblurring/deblurrer.py - Image restoration → Decoder refiner: refines decode
flashrefocus/deblurring/deblurrer.py - Bokeh renderer → Defocus attention: uses attention
flashrefocus/rendering/renderer.py - User → ComfyUI nodes: uses nodes
- ComfyUI nodes → Refocuser pipeline: prepares scenes
comfyui/nodes.py - ComfyUI nodes → Depth edits: applies edits
comfyui/nodes.py - ComfyUI nodes → Mask segmentation: uses masks
comfyui/nodes.py - Video spotlight → Depth estimation: tracks depth
- Video spotlight → Bokeh renderer: renders frames
- Video spotlight → Mask segmentation: uses subject masks
- Video spotlight → Video overlays: uses overlays
- Restoration training → Restoration data: trains on
training/train_deblurring.py - Renderer training → Renderer data: trains on
training/train_renderer.py - Renderer training → Bokeh renderer: trains model
training/train_renderer.py