@enslo/sd-metadata 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/types.ja.md CHANGED
@@ -8,13 +8,13 @@
8
8
 
9
9
  - [コア型](#コア型)
10
10
  - [`ParseResult`](#parseresult)
11
- - [`BaseMetadata`](#basemetadata)
12
11
  - [`GenerationMetadata`](#generationmetadata)
13
12
  - [`GenerationSoftware`](#generationsoftware)
14
13
  - [`EmbedMetadata`](#embedmetadata)
15
14
  - [`RawMetadata`](#rawmetadata)
16
15
  - [`WriteResult`](#writeresult)
17
16
  - [メタデータ型](#メタデータ型)
17
+ - [`BaseMetadata`](#basemetadata)
18
18
  - [`StandardMetadata`](#standardmetadata)
19
19
  - [`NovelAIMetadata`](#novelaimetadata)
20
20
  - [`ComfyUIMetadata`](#comfyuimetadata)
@@ -92,46 +92,6 @@ switch (result.status) {
92
92
 
93
93
  ---
94
94
 
95
- ### `BaseMetadata`
96
-
97
- 全メタデータ型で共有される共通フィールド。`GenerationMetadata` の各バリアントと `EmbedMetadata` の基盤です。
98
-
99
- ```typescript
100
- export interface BaseMetadata {
101
- /** ポジティブプロンプト */
102
- prompt: string;
103
- /** ネガティブプロンプト */
104
- negativePrompt: string;
105
- /** 画像の幅(ピクセル) */
106
- width: number;
107
- /** 画像の高さ(ピクセル) */
108
- height: number;
109
- /** モデル設定 */
110
- model?: ModelSettings;
111
- /** サンプリング設定 */
112
- sampling?: SamplingSettings;
113
- /** Hires.fix設定(適用されている場合) */
114
- hires?: HiresSettings;
115
- /** アップスケール設定(適用されている場合) */
116
- upscale?: UpscaleSettings;
117
- }
118
- ```
119
-
120
- **例:**
121
-
122
- ```typescript
123
- import type { BaseMetadata } from '@enslo/sd-metadata';
124
-
125
- // 共通の生成フィールドのみ必要な場合にBaseMetadataを使用
126
- function displayMetadata(meta: BaseMetadata) {
127
- console.log('Prompt:', meta.prompt);
128
- console.log('Size:', meta.width, 'x', meta.height);
129
- console.log('Model:', meta.model?.name);
130
- }
131
- ```
132
-
133
- ---
134
-
135
95
  ### `GenerationMetadata`
136
96
 
137
97
  統一されたメタデータ構造。サポートされている全てのメタデータ型のユニオン型。全バリアントが `BaseMetadata` を拡張しています。
@@ -343,6 +303,46 @@ export type WriteWarning = {
343
303
 
344
304
  ## メタデータ型
345
305
 
306
+ ### `BaseMetadata`
307
+
308
+ 全メタデータ型で共有される共通フィールド。`GenerationMetadata` の各バリアントと `EmbedMetadata` の基盤です。
309
+
310
+ ```typescript
311
+ export interface BaseMetadata {
312
+ /** ポジティブプロンプト */
313
+ prompt: string;
314
+ /** ネガティブプロンプト */
315
+ negativePrompt: string;
316
+ /** 画像の幅(ピクセル) */
317
+ width: number;
318
+ /** 画像の高さ(ピクセル) */
319
+ height: number;
320
+ /** モデル設定 */
321
+ model?: ModelSettings;
322
+ /** サンプリング設定 */
323
+ sampling?: SamplingSettings;
324
+ /** Hires.fix設定(適用されている場合) */
325
+ hires?: HiresSettings;
326
+ /** アップスケール設定(適用されている場合) */
327
+ upscale?: UpscaleSettings;
328
+ }
329
+ ```
330
+
331
+ **例:**
332
+
333
+ ```typescript
334
+ import type { BaseMetadata } from '@enslo/sd-metadata';
335
+
336
+ // 共通の生成フィールドのみ必要な場合にBaseMetadataを使用
337
+ function displayMetadata(meta: BaseMetadata) {
338
+ console.log('Prompt:', meta.prompt);
339
+ console.log('Size:', meta.width, 'x', meta.height);
340
+ console.log('Model:', meta.model?.name);
341
+ }
342
+ ```
343
+
344
+ ---
345
+
346
346
  ### `StandardMetadata`
347
347
 
348
348
  ほとんどのSDツールで使用される標準パラメータフォーマット。
package/docs/types.md CHANGED
@@ -8,13 +8,13 @@ Complete type reference for `@enslo/sd-metadata`.
8
8
 
9
9
  - [Core Types](#core-types)
10
10
  - [`ParseResult`](#parseresult)
11
- - [`BaseMetadata`](#basemetadata)
12
11
  - [`GenerationMetadata`](#generationmetadata)
13
12
  - [`GenerationSoftware`](#generationsoftware)
14
13
  - [`EmbedMetadata`](#embedmetadata)
15
14
  - [`RawMetadata`](#rawmetadata)
16
15
  - [`WriteResult`](#writeresult)
17
16
  - [Metadata Types](#metadata-types)
17
+ - [`BaseMetadata`](#basemetadata)
18
18
  - [`StandardMetadata`](#standardmetadata)
19
19
  - [`NovelAIMetadata`](#novelaimetadata)
20
20
  - [`ComfyUIMetadata`](#comfyuimetadata)
@@ -92,46 +92,6 @@ switch (result.status) {
92
92
 
93
93
  ---
94
94
 
95
- ### `BaseMetadata`
96
-
97
- Common fields shared by all metadata types. This is the foundation for both `GenerationMetadata` variants and `EmbedMetadata`.
98
-
99
- ```typescript
100
- export interface BaseMetadata {
101
- /** Positive prompt */
102
- prompt: string;
103
- /** Negative prompt */
104
- negativePrompt: string;
105
- /** Image width in pixels */
106
- width: number;
107
- /** Image height in pixels */
108
- height: number;
109
- /** Model settings */
110
- model?: ModelSettings;
111
- /** Sampling settings */
112
- sampling?: SamplingSettings;
113
- /** Hires.fix settings (if applied) */
114
- hires?: HiresSettings;
115
- /** Upscale settings (if applied) */
116
- upscale?: UpscaleSettings;
117
- }
118
- ```
119
-
120
- **Example:**
121
-
122
- ```typescript
123
- import type { BaseMetadata } from '@enslo/sd-metadata';
124
-
125
- // Use BaseMetadata when you only need common generation fields
126
- function displayMetadata(meta: BaseMetadata) {
127
- console.log('Prompt:', meta.prompt);
128
- console.log('Size:', meta.width, 'x', meta.height);
129
- console.log('Model:', meta.model?.name);
130
- }
131
- ```
132
-
133
- ---
134
-
135
95
  ### `GenerationMetadata`
136
96
 
137
97
  Unified metadata structure. Discriminated union of all supported metadata types. All variants extend `BaseMetadata`.
@@ -343,6 +303,46 @@ Returned when metadata was intentionally dropped during a write operation (e.g.,
343
303
 
344
304
  ## Metadata Types
345
305
 
306
+ ### `BaseMetadata`
307
+
308
+ Common fields shared by all metadata types. This is the foundation for both `GenerationMetadata` variants and `EmbedMetadata`.
309
+
310
+ ```typescript
311
+ export interface BaseMetadata {
312
+ /** Positive prompt */
313
+ prompt: string;
314
+ /** Negative prompt */
315
+ negativePrompt: string;
316
+ /** Image width in pixels */
317
+ width: number;
318
+ /** Image height in pixels */
319
+ height: number;
320
+ /** Model settings */
321
+ model?: ModelSettings;
322
+ /** Sampling settings */
323
+ sampling?: SamplingSettings;
324
+ /** Hires.fix settings (if applied) */
325
+ hires?: HiresSettings;
326
+ /** Upscale settings (if applied) */
327
+ upscale?: UpscaleSettings;
328
+ }
329
+ ```
330
+
331
+ **Example:**
332
+
333
+ ```typescript
334
+ import type { BaseMetadata } from '@enslo/sd-metadata';
335
+
336
+ // Use BaseMetadata when you only need common generation fields
337
+ function displayMetadata(meta: BaseMetadata) {
338
+ console.log('Prompt:', meta.prompt);
339
+ console.log('Size:', meta.width, 'x', meta.height);
340
+ console.log('Model:', meta.model?.name);
341
+ }
342
+ ```
343
+
344
+ ---
345
+
346
346
  ### `StandardMetadata`
347
347
 
348
348
  Standard parameters format used by most SD tools.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enslo/sd-metadata",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Read and write AI-generated image metadata",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "CHANGELOG.md"
20
20
  ],
21
21
  "scripts": {
22
- "build": "tsup",
22
+ "build": "tsdown",
23
23
  "test": "vitest run",
24
24
  "test:watch": "vitest",
25
25
  "test:coverage": "vitest run --coverage",
@@ -53,11 +53,11 @@
53
53
  },
54
54
  "homepage": "https://sd-metadata.pages.dev",
55
55
  "devDependencies": {
56
- "@biomejs/biome": "^2.4.4",
57
- "@types/node": "^25.3.1",
58
- "@vitest/coverage-v8": "^4.0.18",
59
- "tsup": "^8.5.1",
60
- "typescript": "^5.9.3",
61
- "vitest": "^4.0.18"
56
+ "@biomejs/biome": "catalog:",
57
+ "@types/node": "catalog:",
58
+ "@vitest/coverage-v8": "^4.1.7",
59
+ "tsdown": "catalog:",
60
+ "typescript": "catalog:",
61
+ "vitest": "catalog:"
62
62
  }
63
63
  }