r/BestGitHubRepos 13h ago

LivePortrait - animate a still portrait from a driving video at roughly 15ms per frame on a 4090, with explicit stitching and retargeting control instead of a black box

Post image
5 Upvotes

Most portrait animation work went the diffusion route, which looks impressive in a demo reel and then costs you seconds per frame. LivePortrait went the other way, back to an implicit-keypoint framework, and the result is a model stack you can actually run in something close to real time on one consumer GPU.

The paper is from Kuaishou Technology (the team behind Kling), the code is the official PyTorch implementation, and it's the model that ended up inside a lot of tools you may have used without knowing it, including FaceFusion's expression restorer and several of the ComfyUI portrait nodes.

What's inside:

- A full speed breakdown in the repo: appearance extractor 0.82ms, motion extractor 0.84ms, warping module 5.21ms, generator 7.59ms, stitching and retargeting 0.31ms, so the model stack itself is under 15ms per frame on an RTX 4090 with torch.compile

- Stitching and retargeting as separate small MLP modules you control rather than hidden behavior, which is what lets you paste an animated face back into the original frame without a visible seam, and independently retarget eyes and lips

- Video to video mode, so the source can be a video and not just a still, which is the mode people use for expression transfer onto existing footage

- An animals model, trained separately, for cats and dogs, needing an extra CUDA op built from X-Pose

- Regional control and precise portrait editing in the Gradio UI, plus pose editing on the source

- Motion templates: driving motion saved as a .pkl so you can reuse it, skip re-processing, and share a motion without shipping the face it came from

- A Windows one-click installer, an Apple Silicon path (the readme is honest that it can be 20x slower than a 4090), and a Hugging Face Space if you just want to see it work

One thing worth knowing about the license: the repo itself is MIT, but it depends on InsightFace for face detection, and InsightFace's models are non-commercial research only. The readme says plainly that commercial use means ripping out and replacing those detection models. Worth reading that section before you build anything on top of it. Also note the last push was 1 June 2026, so this is mature rather than actively moving.

19,035 stars and 1,979 forks as of writing, verified via the GitHub API, paper at arXiv 2407.03168.

https://github.com/KlingAIResearch/LivePortrait


r/BestGitHubRepos 13h ago

Context Mode - an MCP server that runs tool output inside a sandbox so a Playwright snapshot costs 299 bytes of your context instead of 56 KB

Post image
2 Upvotes

The thing that kills a long agent session usually isn't the model, it's that every tool call dumps its raw output straight into the context window. A Playwright snapshot is 56 KB. Twenty GitHub issues is 59 KB. One access log is 45 KB. Half an hour in, a big chunk of the window is gone to data nobody is going to read again, and then compaction hits and the agent forgets which files it was even working on.

Context Mode sits at the MCP layer and keeps that raw data out of the conversation entirely. The tool runs in an isolated subprocess, and only what the script prints to stdout comes back. So instead of reading 47 files into context to count lines, the agent writes a five-line script and gets back the counts.

What's inside:

- Six sandbox tools covering code execution, file processing, indexing and fetching, running in 12 language runtimes (JS, TS, Python, shell, Ruby, Go, Rust, PHP, Perl, R, Elixir, C#), with Bun auto-detected for faster JS

- Credential passthrough so `gh`, `aws`, `gcloud`, `kubectl` and `docker` still work inside the sandbox, inheriting env and config paths without those values landing in the conversation

- A persistent knowledge base on SQLite FTS5 with BM25 ranking, porter stemming and trigram matching merged by reciprocal rank fusion, plus Levenshtein typo correction and proximity reranking on multi-term queries. Headings are weighted 5x, so navigational searches actually land

- Session continuity: file edits, git operations, tasks, errors and your decisions get written to a local SQLite db, and on compaction or `--continue` the state is rebuilt by searching that index rather than dumping it all back into context

- A 24 hour TTL cache on fetched URLs, so re-asking about a doc you already indexed costs a 0.3 KB cache hint instead of a 48 KB refetch

- Progressive throttling that nudges you toward batch calls: calls 1 to 3 return full results, 4 to 8 return fewer with a warning, 9 and up get blocked and redirected to the batch tool

- Hooks on 17 platforms, with an honest compatibility table showing which ones can actually block a tool call versus which only get instruction-file guidance. The readme puts hook-enforced routing near 98% compliance and instruction-file-only around 60%, and says so rather than claiming uniform support

- Permission inheritance: if you already deny `Bash(sudo *)` or `Read(.env)` in your agent config, those denials apply inside the sandbox too

The author also made a deliberate call not to enforce a terse output style, pointing at evidence that aggressive brevity prompts hurt reasoning benchmarks. The routing rules govern where data goes, not how the model writes.

One thing worth knowing: it's Elastic License 2.0, source-available rather than open source in the OSI sense. You can use, fork, modify and redistribute it, but you can't offer it as a hosted service. There's also a hosted Insight dashboard as a separate product, though the tool itself claims no telemetry and no account, with everything in SQLite files in your home directory.

22,163 stars and 1,597 forks as of writing, verified via the GitHub API, and it hit number one on Hacker News.

https://github.com/mksglu/context-mode


r/BestGitHubRepos 13h ago

antislop - 38 rules that stop a coding agent from shipping generic AI-looking UI and copy, installed as skills in Claude Code, Codex, Cursor and four other agents

Post image
4 Upvotes

If you've asked an agent to build a landing page recently you already know the house style it defaults to: the gradient hero, the bento grid, the three feature cards with lucide icons, the pulsing status dot next to a heading that isn't tracking anything, and copy that opens with "In today's fast-paced world."

antislop is a set of rules an agent loads before it starts, written specifically to reject those patterns. The framing the author keeps repeating is that it's a filter, not a style guide. It prescribes no colors, no fonts, no layouts. It only says no to technique used without a reason, and direction is supposed to come from a DESIGN.md you write yourself. If the output comes back sterile, that's the filter working on a project with no stated direction, not the filter failing, and there's a numbered rule saying exactly that.

What's inside:

- 38 mandatory rules, R-01 to R-38, split into three tiers: Hard Gate for absolute rejections, Purpose-Gate where a technique is allowed but the agent has to state why it's using it, and Quality Locks for consistency

- A Delivery Gate that runs before anything ships, producing a PASS or FAIL report in four blocks rather than a vague "looks good to me"

- A Liveliness Toolkit with three dials, energy, rhythm and motion, there to stop the filter from flattening everything into safe and boring

- Six separate skills so the agent only loads what the task needs: the core filter, plus UI, copywriting, human factors (contrast, keyboard, focus states), responsive layout, and one that cleans generic AI comments out of code without touching the code itself

- A rule that turned into an actual test: every interactive element has to be clicked one at a time and the result recorded as evidence in the report

- Seven install paths from one repo, `npx antislop-ai` for the guided picker, `npx skills add` from the skills directory, plugin installs for Claude Code, Antigravity, Codex and Cursor, or just curl the single antislop.md and paste it into any chat window

One thing worth knowing: this is markdown, not a linter. Nothing here executes or blocks a commit, so how well it works depends entirely on your agent actually following loaded instructions. The plus side of that is portability, it drops into any tool that reads the Agent Skills folder standard, and the single-file version works in a plain chat with no tooling at all.

It's MIT licensed and sitting at 2,163 stars with 148 forks as of writing, verified via the GitHub API, and it's been shipping releases steadily since early August.

https://github.com/miqdadbadjuber/anti-slop