Harris
Free guide · the exact setup

Look at the hair.

Phone cutouts give themselves away at the edges.
This free setup doesn't.
Open-source tools. One command.

Get the free script
Old cutout: smeared curly hair with a light halo.
This setup: the same hair with clean edges.
OldNew

Drag the circle. Same frame, old and new.

The problem

Why phone cutouts look fake

  • Smeared hair

    The edges look painted on. Curls turn into a blur.

  • See-through

    The new background shows through your hair and head.

  • A light halo

    A pale fringe of the old wall clings to your outline.

Pros fix this before they edit. Then the right tools do the rest.

The biggest win · free

Film it right

Five things. Before you press record.

  • A plain, darker, matte wall

    Behind you. Not a white wall.

  • Light in front of you

    Face the window. Never a window behind you.

  • Lock your exposure

    So the wall never blows out to white. Tap and hold on your face in the camera app.

  • Space above your head

    Leave a hand's width between your hair and the top of the frame.

  • Film in 4K if you can

    At the highest quality setting your phone has.

Good footage in = clean cutout out.

Real footage

Room in. Studio out.

Left: my real room, filmed on a phone. Right: the same clip, cut out with this setup and put on a studio set.

1.5–3 sper frame on an RTX 3060 (we measured both)
35–70 minfor a 45 second Short
5.4 GBabout, of graphics memory

How long it takes: start it, and go and do something else.

RoomStudio

Get the free script

Two small files. Put both in one folder.

Free. No email needed. The full steps are on this page.

Before you start

What you need

  • A Windows PC with an NVIDIA graphics card.
  • We run it on an RTX 3060 12 GB.
  • It uses about 5.4 GB of graphics memory.
  • About 3 GB of free disk space.

Mac: there is no NVIDIA card on a Mac. It still runs with --cpu, but it is very slow.

Linux: the same steps work. Use python3 and source .venv/bin/activate.

Proof
Straight from the free scriptA frame made by the free script: a man with curly hair cut out of a phone video and placed on a dark studio set. Clean curls, no halo, nothing showing through.
Made with the free script, one command, no hand editing. Look at the curls at the edge.
The setup

6 steps, top to bottom

Copy each line with the button. Paste it. Press Enter.

  1. Step 1: Install Python 3.12

    1. Go to python.org/downloads.
    2. Download Python 3.12 for Windows.
    3. Run the installer.
    4. Tick "Add python.exe to PATH".
    5. Click Install Now.
  2. Step 2: Install ffmpeg

    1. Open PowerShell (Start menu, type "PowerShell").
    2. Paste this line and press Enter:
    winget install Gyan.FFmpeg
    • Close PowerShell and open it again.
    • Check it works. You should see a version number:
    ffmpeg -version
  3. Step 3: Make a folder and a venv

    1. A "venv" is a clean box for this tool.
    2. It keeps it away from everything else on your PC.
    3. Put cutout_pro.py and requirements.txt in a folder, for example C:\cutout.
    4. Then, in PowerShell, one line at a time:
    cd C:\cutout
    py -3.12 -m venv .venv
    .venv\Scripts\activate
    • You now see (.venv) at the start of the line.
    If it says "running scripts is disabled"Run this once, then try again:
    Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  4. Step 4: Install the tools

    1. First, PyTorch with CUDA (one line):
    pip install torch==2.11.0 torchvision==0.26.0 --index-url https://download.pytorch.org/whl/cu128
    • Then everything else:
    pip install -r requirements.txt
    Do not use plain pip install torchOn Windows that gives the slow CPU-only version.
  5. Step 5: Test on 3 seconds first

    1. Copy your video into the folder. Then:
    python cutout_pro.py my_video.mp4 --start 5 --duration 3
    • The first run downloads the model (about 450 MB). That is once only.
    • You will see:

    frame 10/90 1.52 s/frame ~2.0 min left

  6. Step 6: Put yourself on a new background

    1. Add --bg with any image or video:
    python cutout_pro.py my_video.mp4 --bg studio.jpg
    • Leave out --start and --duration to do the whole video.

What you get

  • my_video_cutout.mov

    You, with a transparent background.

    Drop it on any background in Premiere, Resolve, Final Cut, After Effects or CapCut desktop.

  • my_video_on_bg.mp4

    You on the new background, ready to post.

    Only when you add --bg.

NormalBoth keep your original sound. The .mov is big (ProRes 4444, about 1 GB a minute). That is normal. It keeps the hair edges perfect.

If something goes wrong

"No CUDA GPU found"
  • Update your NVIDIA driver (nvidia.com/drivers).
  • Re-run the PyTorch line from step 4.
"ran out of memory"
  • Close games, video editors and other AI apps.
  • Or add --max-size 1280.
"ffmpeg not found"
  • Close and reopen PowerShell after step 2.
Phone video comes out sideways?
  • It shouldn't: the script reads the phone's rotation for you.

Useful options

--start 10start 10 seconds in
--duration 3only do 3 seconds
--bg filealso put you on this image or video
--out foldersave the results somewhere else
--max-size 1280smaller and faster (default 1920)
--fps 30output frame rate (default 30)
--cpuno NVIDIA card: works, but very slow
Under the hood

How it works

  1. Find you

    BiRefNet_HR-matting finds you in every frame, at 2048 x 2048.

  2. Steady the edges

    A motion-aware blend steadies the edges between frames. Still areas are smoothed. Moving hands stay sharp, so no ghosting.

  3. Fix the hair colour

    pymatting re-solves the colour of the hair edges, so the old wall colour leaves your hair. No white fringe.

  4. Fill the middle

    A solid-core fill makes the inside of you fully solid, so the new background never shows through your head.

Licences

All free. Commercial use is fine.

  • BiRefNet (the model)MIT. Free, commercial use OK.
  • pymattingMIT. Free, commercial use OK.
  • PyTorch, ffmpeg, OpenCVOpen source.
  • MatAnyoneNot used. Its licence is non-commercial.
  • cutout_pro.pyFree to use and change.
Three close-ups of the same curly hair: A old cutout with smeared edges and a light halo, B old cutout with colour fix, C this setup with clean edges.
The same frame, three ways. A: the old engine (smeared, see-through hair, a light halo). B: old engine plus colour fix. C: this setup. Clean edges, solid.

Rather not do it yourself?

Harris can set this up for you.
Same free tools, set up on your own PC.

See what Harris does