Skip to content

About

Plugins for Constructive Media: adapters that fill the engine's slots, each a package you choose to install

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

media-engine-plugins

Constructive

Adapters for Constructive Media, each a plugin you choose to install.

A plugin fills one of the engine's slots with another tool: a rack of effects, a detector, a voice converter, a model that makes video. Each is a package of its own that you choose to install. The engine never imports any of them by name: it finds an installed plugin through an entry point, and works the same without one.

Features

  • 🔌 Pluggable by slot — each plugin fills one adapter slot of the engine, and media adapters lists it beside the built-in adapters, with the package it came from
  • 🙋 Yours to choose — a plugin is never the default: CONSTRUCTIVE_MEDIA_ADAPTER_<SLOT> chooses it, and installing one changes nothing until then
  • 🎛️ pedalboard-effects — fills effects: the reverb, delay, compression and gain a .conv script asks for in media say, through pedalboard
  • 🔍 ultralytics-detection — fills detection: Ultralytics YOLO detectors for media detect
  • 🗣️ seedvc-conversion — fills voice_conversion: media revoice says a recording again in another voice, and media talk --voice WHO --quick NAME answers in a persona's voice
  • 🎞️ ltx-video — fills video: a still made to move, with media generate video "…" --from PICTURE --adapter ltx
  • 🎤 demucs-separation — fills separation: media separate takes a voice out from over music
  • 👄 latentsync-lipsync — fills lip_sync: media lipsync makes the face in a video say a recording
  • 🧩 Write your own — an ordinary Python package with an entry point in the constructive_media.adapters group; no change to the engine is needed

The plugins

Plugin Fills the slot Chosen as Tool License
pedalboard-effects effects pedalboard pedalboard GPL-3.0-only
ultralytics-detection detection ultralytics Ultralytics YOLO AGPL-3.0-only
seedvc-conversion voice_conversion seedvc Seed-VC GPL-3.0-only
ltx-video video ltx LTX-Video Code MIT; the model under Lightricks' terms
demucs-separation separation demucs Demucs Code MIT; the weights for research only
latentsync-lipsync lip_sync latentsync LatentSync Code MIT; the weights under use restrictions and the face models for non-commercial research

Install

Install the engine first, then the plugins you want, into the same environment:

pip install "./constructive-media[all]"
pip install ./media-engine-plugins/plugins/pedalboard-effects
pip install ./media-engine-plugins/plugins/ultralytics-detection
pip install ./media-engine-plugins/plugins/seedvc-conversion       # Python 3.11 or 3.12
pip install ./media-engine-plugins/plugins/ltx-video               # fetches about 26 GB of weights when first used
pip install ./media-engine-plugins/plugins/demucs-separation       # fetches about 84 MB of weights when first used
pip install ./media-engine-plugins/plugins/latentsync-lipsync      # needs a checkout of LatentSync; about 6 GB of weights

media adapters

media adapters lists every adapter the engine can see, with its license and where it came from:

effects: audio effects
 * ffmpeg       MIT           builtin                  Reverb, delay, compression and gain through the ffmpeg program
   pedalboard   GPL-3.0-only  media-engine-pedalboard  Reverb, delay, compression and gain with pedalboard's studio effects

Use

A plugin is never the default. Installing one changes nothing until you choose it, by slot:

export CONSTRUCTIVE_MEDIA_ADAPTER_EFFECTS=pedalboard
export CONSTRUCTIVE_MEDIA_ADAPTER_DETECTION=ultralytics
export CONSTRUCTIVE_MEDIA_ADAPTER_VOICE_CONVERSION=seedvc
export CONSTRUCTIVE_MEDIA_ADAPTER_VIDEO=ltx
export CONSTRUCTIVE_MEDIA_ADAPTER_SEPARATION=demucs
export CONSTRUCTIVE_MEDIA_ADAPTER_LIP_SYNC=latentsync

The first two take the place of an adapter the engine has of its own. The third fills a slot the engine leaves empty: without it, media revoice and media talk --quick say what to install. The fourth does something the engine's own video adapter does not, which is to start from a picture, and it can be asked for one piece at a time instead:

media generate video "fog drifting over the water" --from harbour.png --adapter ltx

The fifth fills another slot the engine leaves empty: without it, media separate says what to install. With it, a voice is taken out from over music:

media separate song.wav parts --adapter demucs     # parts/voice.wav, parts/rest.wav

The sixth fills one more: without it, media lipsync says that nothing fills the slot. With it, and a checkout of LatentSync that it is told the place of, the face in a video is made to say a recording:

export CONSTRUCTIVE_MEDIA_EXTRA_LIP_SYNC='{"repo": "~/LatentSync"}'
media lipsync face.mp4 line.wav out/face-says-line.mp4 --adapter latentsync

It is the one plugin here that installs nothing of the tool it drives: LatentSync is run where it was cloned, by a Python of its own.

Licenses

There is no license for the repository as a whole. Each plugin is a separate package under the license in its own folder. For a plugin that drives a library, that is the library's license. For one that runs a model published under terms of its own, the code is MIT and the model's terms are named on the adapter and set out in the plugin's README.

Installing a plugin does not change the engine's license. It does change what you are running: a program that includes a GPL or AGPL part is covered by those terms when you pass it on, and the AGPL extends that to people who use it over a network. A model's terms are about the model and what it is used for: some forbid uses outright, some are for research alone, some are for non-commercial use, and some ask larger companies to pay. Read the license of any plugin you install, and the terms of any model it fetches, before you ship what you build with it. This is a description, not legal advice.

No model weights, voices, audio or footage are committed here. A model a plugin downloads comes from whoever publishes it, under their license.

Write your own plugin

A plugin is an ordinary Python package that declares an entry point in the constructive_media.adapters group and returns its adapters, each with its slot, its name and its license stated honestly. What an adapter must do is set by its slot. Both are described in the engine's docs/ADAPTERS.md.

Any slot can be filled this way, and a plugin need not live in this repository: install the package next to constructive-media and media adapters lists it. A plugin cannot replace a built-in adapter.

Tests

Each plugin has its own, in standard-library unittest. With the engine and the plugin installed:

cd plugins/pedalboard-effects && python -m unittest discover -s tests -t .

Sound and images are made by the tests. No trained model is downloaded.

Working with an AI agent

The media-engine-plugins skill at .agents/skills/media-engine-plugins/ covers installing a plugin, choosing it, what its license means and writing a new one. Install it where your agent looks with:

npx skills add https://github.com/constructive-io/media-engine-plugins --skill media-engine-plugins

The engine's repository has the constructive-media skill, for using the engine, and conversation-format has the conv skill, for writing scripts.

Related

About

Plugins for Constructive Media: adapters that fill the engine's slots, each a package you choose to install

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages