Skip to content

Add GIF/animation output for intensity progression #417

@dreamlessx

Description

@dreamlessx

What

Add the ability to generate an animated GIF or MP4 that smoothly transitions from 0% to 100% intensity for a given procedure.

Why

Animated previews are much more compelling for patient consultations and for social media / demo purposes than static images. Seeing the gradual progression makes the prediction feel more trustworthy.

Suggested approach

  1. Generate frames at 2-5% intensity increments (20-50 frames)
  2. Assemble into GIF using imageio or PIL
  3. Optionally output MP4 via cv2.VideoWriter
  4. Add --animate flag to CLI and a toggle in the Gradio demo
python scripts/run_inference.py photo.jpg \
    --procedure rhinoplasty \
    --animate \
    --output rhinoplasty_progression.gif

Considerations

  • Keep frame count reasonable for TPS mode (instant per frame)
  • For ControlNet mode, this is expensive — consider caching the conditioning and only re-running the diffusion
  • Add a progress bar for the generation loop

Difficulty: 🟡 Intermediate

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributingGood for community contributorsenhancementNew feature or request

    Projects

    Status

    Todo

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions