← Back
miyang-ai

miyang-ai/Mi-Ripple

MIYANG diagnosis-guided restoration for digital ripple artifacts in iteratively edited AI images

View on GitHub ↗https://lab.miyang.cn/ripple/ ↗
Stars
225
Forks
6
Watchers
225
Open issues
1
Contributors
3
Language
Python
License
MIT License
Default branch
main
Created Sep 10, 2026Updated Sep 10, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

Mi-Ripple

AI Skill — start here

Open skills/mi-ripple/SKILL.md →

AI coding agents should read this skill first. It contains the complete workflow for installing Mi-Ripple, processing an image, inspecting the generated evidence, requesting permission before paid regeneration, and returning the actual result. The skill never authorizes paid regeneration on the user's behalf.

Install it from the canonical repository:

https://github.com/miyang-ai/Mi-Ripple

Direct skill URL:

https://raw.githubusercontent.com/miyang-ai/Mi-Ripple/main/skills/mi-ripple/SKILL.md

Reference implementation of Mi-Ripple, MIYANG's diagnosis-guided workflow for restoring grid-like and scale-like artifacts introduced by iterative, reference-conditioned AI image editing.

Try Mi-Ripple on the MIYANG Lab website →

Experience Mi-Ripple with Alice →

Visit the MIYANG official website →

Mi-Ripple does not apply one aggressive filter to every image. It first separates:

  • Periodic lattice artifacts: isolated spectral peaks that can be selectively notched with low measured distortion.
  • Granular artifacts in unstructured regions: 3–8 px texture that can be reduced behind a structure-protection mask.
  • Content-entangled artifacts: repeated texture overlapping hair, foliage, fabric, or other legitimate detail. These require human review or optional regeneration from a cleaned reference.

Important

This is a research implementation, not a universal artifact detector. Automatic scores are triage signals. Review the generated heat maps and comparison boards before accepting an output.

Before / after

These are the five comparisons currently used by the MIYANG Lab tool. Open an image to inspect it at native resolution.

Night hair · Image 2.5

Before After
Night hair before restoration Night hair after restoration

The images share the same source composition but come from separate experimental branches: direct regeneration versus cleaned-reference regeneration followed by selective lattice notching. Regeneration is not pixel-aligned restoration and can change fine semantic details.

Moss gorge · Image 2.5

Before After
Moss gorge Image 2.5 before restoration Moss gorge Image 2.5 after restoration

Moss gorge · Image 2.0

Before After
Moss gorge Image 2.0 before restoration Moss gorge Image 2.0 after restoration

Rainforest path · Image 2.0

Before After
Rainforest path before restoration Rainforest path after restoration

Ice cave · Image 2.0

Before After
Ice cave before restoration Ice cave after restoration

Installation

Python 3.11 or newer is required.

git clone https://github.com/miyang-ai/Mi-Ripple.git
cd Mi-Ripple
python -m venv .venv
source .venv/bin/activate
pip install -e .

OpenCV-based face protection is optional:

pip install -e ".[face]"

For development:

pip install -e ".[dev]"
pytest

Quick start

Local deterministic processing is the default:

mi-ripple input.png output/

The output directory contains:

  • a diagnosis JSON and visual inspection boards;
  • intermediate masks and processed candidates;
  • a machine-readable XML decision trace;
  • a final image when the deterministic route can deliver one;
  • a sidecar containing hashes, parameters, measurements, and the final outcome.

If artifacts overlap image content, the default route stops with needs_human_decision. Optional regeneration requires explicit permission and a MIYANG API key:

export MIYANG_API_KEY=...
mi-ripple input.png output/ --allow-regen --max-regen 1

Regeneration may change image content, dimensions, and color. Its output remains a candidate until a person accepts it.

Python API

from pathlib import Path

from mi_ripple.pipeline import run

result = run(Path("input.png"), Path("output"))
print(result["outcome"], result["final"])

Individual measurement and processing modules are also public:

  • mi_ripple.diagnosis
  • mi_ripple.scale_index
  • mi_ripple.notch
  • mi_ripple.spatial
  • mi_ripple.reference
  • mi_ripple.verify

Method and evidence

The accompanying paper is:

Yicheng Xu, Jiayin Chen, and Muting Wang. Mi-Ripple: Restoring Images Degraded by Iterative AI Editing. MIYANG Technology (Shanghai) Co., Ltd., 2026.

The LaTeX manuscript, references, and publication figures are included in paper/.

Paper figures

Restoration results across moss gorge, wisteria tunnel, and ice cave

Artifact forms Targeted restoration
Periodic lattice and granular artifact forms Before and after facial restoration

Selective notch versus broad spectral suppression

Input, selective notch, and soft-clipping comparison

Residual comparison for selective notch and soft clipping

See docs/ALGORITHM.md for the decision flow and docs/LIMITATIONS.md before interpreting reported scores. Provider integration and billing boundaries are documented in docs/REGENERATION.md. The publication-ready manuscript will be linked here when its permanent public record is available.

The test suite uses synthetic deterministic inputs. The documented comparison and paper figures are curated publication assets; private user images and internal production archives are not included.

Contributors

See CONTRIBUTORS.md.

Brand and license

The source code is released under the MIT License.

MIYANG, its logo, and associated product branding are trademarks or brand assets of MIYANG Technology (Shanghai) Co., Ltd. The MIT License does not grant rights to use those marks. See TRADEMARKS.md.

Copyright © 2026 MIYANG Technology (Shanghai) Co., Ltd.