Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/mir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: mir pytest

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies and run tests
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.12
uv python pin 3.12
uv sync --group dev
uv venv .venv
source .venv/bin/activate
pytest -v
147 changes: 132 additions & 15 deletions MIR.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,170 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: nnll[dev]@ git+https://github.com/darkshapes/nnll.git
Requires-Dist: diffusers>=0.35.2
Requires-Dist: huggingface-hub[hf-xet]>=1.1.7
Requires-Dist: pydantic>=2.12.5
Requires-Dist: tokenizers>=0.22.1
Requires-Dist: torch>=2.9.1
Requires-Dist: torchvision>=0.24.1
Requires-Dist: transformers>=2.3.0
Dynamic: license-file

---
language:
- en
- en
library_name: mir
license_name: MPL-2.0 + Commons Clause 1.0
---

<div align="center">

<picture>
<source media="(prefers-color-scheme: dark)" srcset="img_src/mir300_dark.png" width="50%">
<source media="(prefers-color-scheme: light)" srcset="img_src/mir300_light.png" width="50%">
<img alt="A pixellated logo of superimposed letters M I R",src="img_src/mir300_dark.png">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/darkshapes/entity-statement/refs/heads/main/png/mir/mir300_dark.png" width="50%">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/darkshapes/entity-statement/refs/heads/main/png/mir/mir300_light.png" width="50%">
<img alt="A pixellated logo of superimposed letters M I R",src="https://raw.githubusercontent.com/darkshapes/entity-statement/refs/heads/main/png/mir/mir300_dark.png">
</picture><br><br>

</div>

# MIR (Machine Intelligence Resource)<br><sub>A naming schema for AIGC/ML work.</sub>


The MIR classification format seeks to standardize and complete a hyperlinked network of model information, improving accessibility and reproducibility across the AI community.<br>

This repo is a live development implementation, an example of autogenerating model inference parameters and code with the MIR schema. This is the sister repo to our [🤗HuggingFace MIR project](https://huggingface.co/darkshapes/MIR) which is an archive of model state dict layer information that also uses the MIR schema.
This repo is an example development implementation of autogenerated model inference parameters and code with the MIR schema. This is the sister repo to our [🤗HuggingFace MIR project](https://huggingface.co/darkshapes/MIR) which is an archive of model state dict layer information that also uses the MIR schema.

MIR is inspired by:
- [AIR-URN](https://github.com/civitai/civitai/wiki/AIR-%E2%80%90-Uniform-Resource-Names-for-AI) project by [CivitAI](https://civitai.com/)
- [Spandrel](https://github.com/chaiNNer-org/spandrel/blob/main/libs/spandrel/spandrel/__helpers/registry.py) super-resolution registry by [chaiNNer](https://github.com/chaiNNer-org/chaiNNer)
- [SDWebUI Model Toolkit](https://github.com/silveroxides/stable-diffusion-webui-model-toolkit-revisited) by [silveroxides](https://github.com/silveroxides)
## MIR Schema:

> [!NOTE]
>
> ## Example:
> ## mir : model . transformer . clip-l : stable-diffusion-xl
>
> ## mir : model . transformer . clip-l : stable-diffusion-xl
>
> ```
> mir : model . lora . hyper : flux-1
> ↑ ↑ ↑ ↑ ↑
> [URI]:[Domain].[Architecture].[Series]:[Compatibility]
> ```

### DOMAIN

↑Most Specific/Decentralized

#### Dev

**Pre-release or under evaluation items without an identifier in an expected format**
Anything in in-training, pre-public release, and items under evaluation

Meant to be created by anyone, derived from code and file analysis

- Contextual
- Layers of neural networks
- Dynamic

#### Model

**Publicly released machine learning models with an identifier in the database**
Model weight tensors with arbitrary locations and quantitative dimensions

Meant to be created by file hosts, derived from research pre-prints

- Contextual
- Layers of neural networks
- Fixed

#### Ops

**References to specific optimization or manipulation techniques**
Algorithms, optimizations and procedures for models

Meant to be created by code libraries, derived from research pre-prints

- Universal
- Attributes of neural networks
- Dynamic

#### Info

**Metadata of layer names or settings with an identifier in the database**
Information about the model and tensor specifications

Meant to be created by standards community, derived from code and file analysis

- Universal
- Attributes of neural networks
- Fixed

↓Most General/Centralized

### ARCHITECTURE

| Abbreviation | Description |
| ------------------------------------- | ----------------------------------------- |
| <div align="right">GRU</div> | Gated recurrent unit |
| <div align="right">RBM</div> | Restricted Boltzmann machine |
| <div align="right">TAE</div> | Tiny Autoencoder |
| <div align="right">VAE</div> | Variable Autoencoder |
| <div align="right">LSTM</div> | Long Short-Term Memory |
| <div align="right">RESNET</div> | Residual Network |
| <div align="right">CNN</div> | Convolutional Neural Network |
| <div align="right">RCNN</div> | Region-based Convolutional Neural Network |
| <div align="right">RNN</div> | Recurrent Neural Network |
| <div align="right">BRNN</div> | Bi-directional Recurrent Neural Network |
| <div align="right">GAN</div> | Generative Adversarial Model |
| <div align="right">SSM</div> | State-Space Model |
| <div align="right">DETR</div> | Detection Transformer |
| <div align="right">VIT</div> | Vision Transformer |
| <div align="right">MOE</div> | Mixture of Experts |
| <div align="right">AET</div> | Autoencoding Transformer |
| <div align="right">STST</div> | Sequence-to-Sequence Transformer |
| <div align="right">ART</div> | Autoregressive Transformer |
| <div align="right">LORA</div> | Low-Rank Adaptation |
| <div align="right">CONTROLNET</div> | Controlnet |
| <div align="right">UNCLASSIFIED</div> | Unknown |

--

### SERIES

#### Rules

- Lowercase, hyphen only
- Remove parameter size, non-breaking semantic versioning, library names

Example: `tencent-hunyuan/hunyuandiT-v1.2-diffusers`<br>
SERIES : `hunyuandit-v1`

Example: `black-forest-labs/FLUX.1-dev`<br>
SERIES : `flux1-dev`

In regex (roughly)

```
BREAKING*SUFFIX = r".*(?:-)(prior)$|.*(?:-)(diffusers)$|.\*[\*-](\d{3,4}px|-T2V$|-I2V$)"
PARAMETERS*SUFFIX = r"(\d{1,4}[KkMmBb]|[.*-]\d+[\._-]\d+[Bb][._-]).\*?$"
SEARCH*SUFFIX = r"\d+[.*-]?\d+[BbMmKk](it)?|[._-]\d+[BbMmKk](it)?"
```

### COMPATIBILITY

#### Rules

An additional SERIES label for identifying cross-compatibility

<hr>

If you would like to regenerate or update the example file here, use [nnll](https://github.com/darkshapes/nnll/tree/0.1.dev799):

MIR is inspired by:

- [AIR-URN](https://github.com/civitai/civitai/wiki/AIR-%E2%80%90-Uniform-Resource-Names-for-AI) project by [CivitAI](https://civitai.com/)
- [Spandrel](https://github.com/chaiNNer-org/spandrel/blob/main/libs/spandrel/spandrel/__helpers/registry.py) super-resolution registry by [chaiNNer](https://github.com/chaiNNer-org/chaiNNer)
- [SDWebUI Model Toolkit](https://github.com/silveroxides/stable-diffusion-webui-model-toolkit-revisited) by [silveroxides](https://github.com/silveroxides)

<!--
[![Python application](https://github.com/darkshapes/MIR/actions/workflows/mir.yml/badge.svg)](https://github.com/darkshapes/MIR/actions/workflows/python-app.yml)<br> -->

![commits per month](https://img.shields.io/github/commit-activity/m/darkshapes/MIR?color=indigo)<br>
![code size](https://img.shields.io/github/languages/code-size/darkshapes/MIR?color=navy)<br>
[<img src="https://img.shields.io/discord/1266757128249675867?color=5865F2">](https://discord.gg/VVn9Ku74Dk)<br>
Expand All @@ -86,6 +205,4 @@ MIR is inspired by:
### [About this project](https://github.com/darkshapes/sdbx/wiki/)<br>

</div>



````
58 changes: 55 additions & 3 deletions MIR.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,67 @@
LICENSE
README.md
pyproject.toml
uv.lock
.github/workflows/mir.yml
MIR.egg-info/PKG-INFO
MIR.egg-info/SOURCES.txt
MIR.egg-info/dependency_links.txt
MIR.egg-info/entry_points.txt
MIR.egg-info/requires.txt
MIR.egg-info/top_level.txt
img_src/mir300_dark.png
img_src/mir300_light.png
docs/index.html
docs/mir.html
docs/search.js
docs/mir/automata.html
docs/mir/config.html
docs/mir/doc_parser.html
docs/mir/indexers.html
docs/mir/inspect.html
docs/mir/maid.html
docs/mir/run.html
docs/mir/tag.html
docs/mir/config/constants.html
docs/mir/config/conversion.html
docs/mir/config/json_io.html
docs/mir/inspect/classes.html
docs/mir/inspect/metadata.html
docs/mir/inspect/parenting.html
docs/mir/inspect/pipes.html
docs/mir/inspect/tasks.html
mir/__init__.py
mir/__main__.py
mir/automata.py
mir/doc_parser.py
mir/indexers.py
mir/maid.py
mir/mir.json
mir/template.json
mir/tag.py
mir/config/__init__.py
mir/config/constants.py
mir/config/conversion.py
mir/config/json_io.py
mir/config/logging.py
mir/inspect/__init__.py
mir/inspect/classes.py
mir/inspect/metadata.py
mir/inspect/parenting.py
mir/inspect/pipes.py
mir/inspect/tasks.py
mir/spec/mir.py
mir/spec/modes.json
mir/spec/template.json
mir/spec/versions.json
tests/test_class_parent.py
tests/test_deconstructors_root.py
tests/test_doc_parser.py
tests/test_gather_diffusers_metadata.py
tests/test_json_io.py
tests/test_mir_db_create_restore.py
tests/test_mir_merge.py
tests/test_mir_search.py
tests/test_mir_tagging.py
tests/test_regex_constants.py
tests/test_resolve_code_names.py
tests/test_seek_class.py
tests/test_task.py
tests/test_taskanalyzer.py
8 changes: 7 additions & 1 deletion MIR.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
nnll[dev]@ git+https://github.com/darkshapes/nnll.git
diffusers>=0.35.2
huggingface-hub[hf-xet]>=1.1.7
pydantic>=2.12.5
tokenizers>=0.22.1
torch>=2.9.1
torchvision>=0.24.1
transformers>=2.3.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ MIR is inspired by:
<!--
[![Python application](https://github.com/darkshapes/MIR/actions/workflows/mir.yml/badge.svg)](https://github.com/darkshapes/MIR/actions/workflows/python-app.yml)<br> -->

[![mir pytest](https://github.com/darkshapes/MIR/actions/workflows/mir.yml/badge.svg)](https://github.com/darkshapes/MIR/actions/workflows/mir.yml)
![commits per month](https://img.shields.io/github/commit-activity/m/darkshapes/MIR?color=indigo)<br>
![code size](https://img.shields.io/github/languages/code-size/darkshapes/MIR?color=navy)<br>
[<img src="https://img.shields.io/discord/1266757128249675867?color=5865F2">](https://discord.gg/VVn9Ku74Dk)<br>
Expand Down
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./mir.html"/>
</head>
</html>
Loading