huggingface / huggingface/diffusers

AI-generated image provenance metadata (EU AI Act deepfake disclosure)

オープン
#13,359 コメント 6 件 リアクション 3 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
34.5k
フォーク
7.3k
平均マージ
3日 3時間
マージ済み PR(30日)
91

説明

## Context

Diffusers generates images that get saved and distributed. Under EU AI Act Article 50 (August 2, 2026), AI-generated images disclosed publicly must carry transparency metadata. Deepfake disclosure becomes mandatory.

Currently, when you run:

```python
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
image = pipe("a sunset over mountains").images[0]
image.save("output.png")
```

The saved PNG has no metadata indicating it's AI-generated. A recipient has no way to know its origin.

## The Gap

Photos from cameras carry EXIF (camera model, GPS, timestamp). AI-generated images carry nothing. There's no standard EXIF/XMP field for:

- `AIGenerated: True`
- `AIModel: stable-diffusion-xl-base-1.0`
- `AIPrompt: "a sunset over mountains"` (optional)
- `GeneratedAt: 2026-03-28T12:00:00Z`

## Possible Approach

Diffusers could optionally embed provenance into saved images:

```python
image.save("output.png",
pnginfo=PngInfo() # already supported
)
# Could include AI provenance in PNG tEXt chunks or EXIF
```

This could be:
1. **Opt-in flag** — `pipe(..., embed_provenance=True)`
2. **Default on, opt-out** — more aggressive but helps compliance
3. **Separate utility** — `diffusers.utils.embed_provenance(image, model_name=...)`

## Why Diffusers Specifically

- Diffusers is the most popular image generation library
- Images are the primary target of EU AI Act deepfake provisions
- Pillow (which diffusers uses) already supports custom EXIF/XMP writing
- C2PA exists but requires Certificate Authority infrastructure — a lightweight EXIF-based approach would have much broader adoption

## Existing Formats

- [C2PA](https://c2pa.org/) — media provenance with PKI (heavy)
- [AKF](https://akf.dev) — lightweight JSON provenance for 20+ formats including images
- Custom EXIF/XMP — simplest, most compatible

Not advocating for any specific format — the important thing is that diffusers outputs carry *some* provenance. What does the team think?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Issueに示されているパイプライン出力とPillow's image.save/PngInfoのパスから始めます。リポジトリのファイルやテストは指定されていません。提案されているオプトイン、デフォルト、ユーティリティのアプローチを、C2PAおよびカスタムメタデータ形式と比較します。完了には、合意された来歴形式とAPIの動作に加え、保存されたPNGメタデータのカバレッジが必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
computer-vision, machine-learning
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。