pixelkiln 0.99.0 → 0.100.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/dist/index.d.cts CHANGED
@@ -5718,6 +5718,17 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
5718
5718
  * (a sword hand, a parted fringe) comes out the other way round.
5719
5719
  */
5720
5720
  mirror: z.ZodOptional<z.ZodString>;
5721
+ /**
5722
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
5723
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
5724
+ * instead of starting from nothing.
5725
+ */
5726
+ initImage: z.ZodOptional<z.ZodString>;
5727
+ /**
5728
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
5729
+ * PixelLab's default is 300.
5730
+ */
5731
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
5721
5732
  /**
5722
5733
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
5723
5734
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -5986,6 +5997,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
5986
5997
  } | undefined;
5987
5998
  concept?: string | undefined;
5988
5999
  mirror?: string | undefined;
6000
+ initImage?: string | undefined;
6001
+ initImageStrength?: number | undefined;
5989
6002
  terrainReferences?: {
5990
6003
  lower?: string | undefined;
5991
6004
  upper?: string | undefined;
@@ -6159,6 +6172,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6159
6172
  } | undefined;
6160
6173
  concept?: string | undefined;
6161
6174
  mirror?: string | undefined;
6175
+ initImage?: string | undefined;
6176
+ initImageStrength?: number | undefined;
6162
6177
  terrainReferences?: {
6163
6178
  lower?: string | undefined;
6164
6179
  upper?: string | undefined;
@@ -6338,6 +6353,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6338
6353
  } | undefined;
6339
6354
  concept?: string | undefined;
6340
6355
  mirror?: string | undefined;
6356
+ initImage?: string | undefined;
6357
+ initImageStrength?: number | undefined;
6341
6358
  terrainReferences?: {
6342
6359
  lower?: string | undefined;
6343
6360
  upper?: string | undefined;
@@ -6511,6 +6528,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6511
6528
  } | undefined;
6512
6529
  concept?: string | undefined;
6513
6530
  mirror?: string | undefined;
6531
+ initImage?: string | undefined;
6532
+ initImageStrength?: number | undefined;
6514
6533
  terrainReferences?: {
6515
6534
  lower?: string | undefined;
6516
6535
  upper?: string | undefined;
@@ -8422,6 +8441,17 @@ declare const ManifestSchema: z.ZodObject<{
8422
8441
  * (a sword hand, a parted fringe) comes out the other way round.
8423
8442
  */
8424
8443
  mirror: z.ZodOptional<z.ZodString>;
8444
+ /**
8445
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
8446
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
8447
+ * instead of starting from nothing.
8448
+ */
8449
+ initImage: z.ZodOptional<z.ZodString>;
8450
+ /**
8451
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
8452
+ * PixelLab's default is 300.
8453
+ */
8454
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
8425
8455
  /**
8426
8456
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
8427
8457
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -8690,6 +8720,8 @@ declare const ManifestSchema: z.ZodObject<{
8690
8720
  } | undefined;
8691
8721
  concept?: string | undefined;
8692
8722
  mirror?: string | undefined;
8723
+ initImage?: string | undefined;
8724
+ initImageStrength?: number | undefined;
8693
8725
  terrainReferences?: {
8694
8726
  lower?: string | undefined;
8695
8727
  upper?: string | undefined;
@@ -8863,6 +8895,8 @@ declare const ManifestSchema: z.ZodObject<{
8863
8895
  } | undefined;
8864
8896
  concept?: string | undefined;
8865
8897
  mirror?: string | undefined;
8898
+ initImage?: string | undefined;
8899
+ initImageStrength?: number | undefined;
8866
8900
  terrainReferences?: {
8867
8901
  lower?: string | undefined;
8868
8902
  upper?: string | undefined;
@@ -9042,6 +9076,8 @@ declare const ManifestSchema: z.ZodObject<{
9042
9076
  } | undefined;
9043
9077
  concept?: string | undefined;
9044
9078
  mirror?: string | undefined;
9079
+ initImage?: string | undefined;
9080
+ initImageStrength?: number | undefined;
9045
9081
  terrainReferences?: {
9046
9082
  lower?: string | undefined;
9047
9083
  upper?: string | undefined;
@@ -9215,6 +9251,8 @@ declare const ManifestSchema: z.ZodObject<{
9215
9251
  } | undefined;
9216
9252
  concept?: string | undefined;
9217
9253
  mirror?: string | undefined;
9254
+ initImage?: string | undefined;
9255
+ initImageStrength?: number | undefined;
9218
9256
  terrainReferences?: {
9219
9257
  lower?: string | undefined;
9220
9258
  upper?: string | undefined;
@@ -9497,6 +9535,8 @@ declare const ManifestSchema: z.ZodObject<{
9497
9535
  } | undefined;
9498
9536
  concept?: string | undefined;
9499
9537
  mirror?: string | undefined;
9538
+ initImage?: string | undefined;
9539
+ initImageStrength?: number | undefined;
9500
9540
  terrainReferences?: {
9501
9541
  lower?: string | undefined;
9502
9542
  upper?: string | undefined;
@@ -9774,6 +9814,8 @@ declare const ManifestSchema: z.ZodObject<{
9774
9814
  } | undefined;
9775
9815
  concept?: string | undefined;
9776
9816
  mirror?: string | undefined;
9817
+ initImage?: string | undefined;
9818
+ initImageStrength?: number | undefined;
9777
9819
  terrainReferences?: {
9778
9820
  lower?: string | undefined;
9779
9821
  upper?: string | undefined;
@@ -12044,6 +12086,17 @@ declare const ManifestInputSchema: z.ZodObject<{
12044
12086
  * (a sword hand, a parted fringe) comes out the other way round.
12045
12087
  */
12046
12088
  mirror: z.ZodOptional<z.ZodString>;
12089
+ /**
12090
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
12091
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
12092
+ * instead of starting from nothing.
12093
+ */
12094
+ initImage: z.ZodOptional<z.ZodString>;
12095
+ /**
12096
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
12097
+ * PixelLab's default is 300.
12098
+ */
12099
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
12047
12100
  /**
12048
12101
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
12049
12102
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -12312,6 +12365,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12312
12365
  } | undefined;
12313
12366
  concept?: string | undefined;
12314
12367
  mirror?: string | undefined;
12368
+ initImage?: string | undefined;
12369
+ initImageStrength?: number | undefined;
12315
12370
  terrainReferences?: {
12316
12371
  lower?: string | undefined;
12317
12372
  upper?: string | undefined;
@@ -12485,6 +12540,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12485
12540
  } | undefined;
12486
12541
  concept?: string | undefined;
12487
12542
  mirror?: string | undefined;
12543
+ initImage?: string | undefined;
12544
+ initImageStrength?: number | undefined;
12488
12545
  terrainReferences?: {
12489
12546
  lower?: string | undefined;
12490
12547
  upper?: string | undefined;
@@ -12664,6 +12721,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12664
12721
  } | undefined;
12665
12722
  concept?: string | undefined;
12666
12723
  mirror?: string | undefined;
12724
+ initImage?: string | undefined;
12725
+ initImageStrength?: number | undefined;
12667
12726
  terrainReferences?: {
12668
12727
  lower?: string | undefined;
12669
12728
  upper?: string | undefined;
@@ -12837,6 +12896,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12837
12896
  } | undefined;
12838
12897
  concept?: string | undefined;
12839
12898
  mirror?: string | undefined;
12899
+ initImage?: string | undefined;
12900
+ initImageStrength?: number | undefined;
12840
12901
  terrainReferences?: {
12841
12902
  lower?: string | undefined;
12842
12903
  upper?: string | undefined;
@@ -13218,6 +13279,8 @@ declare const ManifestInputSchema: z.ZodObject<{
13218
13279
  } | undefined;
13219
13280
  concept?: string | undefined;
13220
13281
  mirror?: string | undefined;
13282
+ initImage?: string | undefined;
13283
+ initImageStrength?: number | undefined;
13221
13284
  terrainReferences?: {
13222
13285
  lower?: string | undefined;
13223
13286
  upper?: string | undefined;
@@ -13594,6 +13657,8 @@ declare const ManifestInputSchema: z.ZodObject<{
13594
13657
  } | undefined;
13595
13658
  concept?: string | undefined;
13596
13659
  mirror?: string | undefined;
13660
+ initImage?: string | undefined;
13661
+ initImageStrength?: number | undefined;
13597
13662
  terrainReferences?: {
13598
13663
  lower?: string | undefined;
13599
13664
  upper?: string | undefined;
@@ -17214,6 +17279,10 @@ interface ResolvedSpec {
17214
17279
  terrainPlatformThickness?: number;
17215
17280
  terrainLowerWalkable?: boolean;
17216
17281
  terrainUpperWalkable?: boolean;
17282
+ /** `pixflux`, `map` and `isometricTile`: the image the drawing starts from, hashed at resolve time. */
17283
+ initImage?: ResolvedTerrainReference & {
17284
+ strength?: number;
17285
+ };
17217
17286
  /** `terrain` generator only: reference PNGs per terrain, hashed at resolve time. A missing file has no hash. */
17218
17287
  terrainReferences?: Partial<Record<"lower" | "upper" | "transition", ResolvedTerrainReference>>;
17219
17288
  terrainTransitionSize?: number;
@@ -20589,6 +20658,9 @@ declare class PixelLabClient {
20589
20658
  outline?: string;
20590
20659
  shading?: string;
20591
20660
  detail?: string;
20661
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20662
+ initImage?: Base64Image;
20663
+ initImageStrength?: number;
20592
20664
  seed?: number;
20593
20665
  /**
20594
20666
  * Style matching: the scene the object should match, and where in it
@@ -20753,6 +20825,9 @@ declare class PixelLabClient {
20753
20825
  outline?: string;
20754
20826
  shading?: string;
20755
20827
  detail?: string;
20828
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20829
+ initImage?: Base64Image;
20830
+ initImageStrength?: number;
20756
20831
  seed?: number;
20757
20832
  }): Promise<{
20758
20833
  tile_id: string;
@@ -20850,6 +20925,9 @@ declare class PixelLabClient {
20850
20925
  height: number;
20851
20926
  noBackground?: boolean;
20852
20927
  paletteSwatchBase64?: string;
20928
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20929
+ initImage?: Base64Image;
20930
+ initImageStrength?: number;
20853
20931
  seed?: number;
20854
20932
  }): Promise<{
20855
20933
  png: Buffer;
package/dist/index.d.ts CHANGED
@@ -5718,6 +5718,17 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
5718
5718
  * (a sword hand, a parted fringe) comes out the other way round.
5719
5719
  */
5720
5720
  mirror: z.ZodOptional<z.ZodString>;
5721
+ /**
5722
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
5723
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
5724
+ * instead of starting from nothing.
5725
+ */
5726
+ initImage: z.ZodOptional<z.ZodString>;
5727
+ /**
5728
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
5729
+ * PixelLab's default is 300.
5730
+ */
5731
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
5721
5732
  /**
5722
5733
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
5723
5734
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -5986,6 +5997,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
5986
5997
  } | undefined;
5987
5998
  concept?: string | undefined;
5988
5999
  mirror?: string | undefined;
6000
+ initImage?: string | undefined;
6001
+ initImageStrength?: number | undefined;
5989
6002
  terrainReferences?: {
5990
6003
  lower?: string | undefined;
5991
6004
  upper?: string | undefined;
@@ -6159,6 +6172,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6159
6172
  } | undefined;
6160
6173
  concept?: string | undefined;
6161
6174
  mirror?: string | undefined;
6175
+ initImage?: string | undefined;
6176
+ initImageStrength?: number | undefined;
6162
6177
  terrainReferences?: {
6163
6178
  lower?: string | undefined;
6164
6179
  upper?: string | undefined;
@@ -6338,6 +6353,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6338
6353
  } | undefined;
6339
6354
  concept?: string | undefined;
6340
6355
  mirror?: string | undefined;
6356
+ initImage?: string | undefined;
6357
+ initImageStrength?: number | undefined;
6341
6358
  terrainReferences?: {
6342
6359
  lower?: string | undefined;
6343
6360
  upper?: string | undefined;
@@ -6511,6 +6528,8 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6511
6528
  } | undefined;
6512
6529
  concept?: string | undefined;
6513
6530
  mirror?: string | undefined;
6531
+ initImage?: string | undefined;
6532
+ initImageStrength?: number | undefined;
6514
6533
  terrainReferences?: {
6515
6534
  lower?: string | undefined;
6516
6535
  upper?: string | undefined;
@@ -8422,6 +8441,17 @@ declare const ManifestSchema: z.ZodObject<{
8422
8441
  * (a sword hand, a parted fringe) comes out the other way round.
8423
8442
  */
8424
8443
  mirror: z.ZodOptional<z.ZodString>;
8444
+ /**
8445
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
8446
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
8447
+ * instead of starting from nothing.
8448
+ */
8449
+ initImage: z.ZodOptional<z.ZodString>;
8450
+ /**
8451
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
8452
+ * PixelLab's default is 300.
8453
+ */
8454
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
8425
8455
  /**
8426
8456
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
8427
8457
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -8690,6 +8720,8 @@ declare const ManifestSchema: z.ZodObject<{
8690
8720
  } | undefined;
8691
8721
  concept?: string | undefined;
8692
8722
  mirror?: string | undefined;
8723
+ initImage?: string | undefined;
8724
+ initImageStrength?: number | undefined;
8693
8725
  terrainReferences?: {
8694
8726
  lower?: string | undefined;
8695
8727
  upper?: string | undefined;
@@ -8863,6 +8895,8 @@ declare const ManifestSchema: z.ZodObject<{
8863
8895
  } | undefined;
8864
8896
  concept?: string | undefined;
8865
8897
  mirror?: string | undefined;
8898
+ initImage?: string | undefined;
8899
+ initImageStrength?: number | undefined;
8866
8900
  terrainReferences?: {
8867
8901
  lower?: string | undefined;
8868
8902
  upper?: string | undefined;
@@ -9042,6 +9076,8 @@ declare const ManifestSchema: z.ZodObject<{
9042
9076
  } | undefined;
9043
9077
  concept?: string | undefined;
9044
9078
  mirror?: string | undefined;
9079
+ initImage?: string | undefined;
9080
+ initImageStrength?: number | undefined;
9045
9081
  terrainReferences?: {
9046
9082
  lower?: string | undefined;
9047
9083
  upper?: string | undefined;
@@ -9215,6 +9251,8 @@ declare const ManifestSchema: z.ZodObject<{
9215
9251
  } | undefined;
9216
9252
  concept?: string | undefined;
9217
9253
  mirror?: string | undefined;
9254
+ initImage?: string | undefined;
9255
+ initImageStrength?: number | undefined;
9218
9256
  terrainReferences?: {
9219
9257
  lower?: string | undefined;
9220
9258
  upper?: string | undefined;
@@ -9497,6 +9535,8 @@ declare const ManifestSchema: z.ZodObject<{
9497
9535
  } | undefined;
9498
9536
  concept?: string | undefined;
9499
9537
  mirror?: string | undefined;
9538
+ initImage?: string | undefined;
9539
+ initImageStrength?: number | undefined;
9500
9540
  terrainReferences?: {
9501
9541
  lower?: string | undefined;
9502
9542
  upper?: string | undefined;
@@ -9774,6 +9814,8 @@ declare const ManifestSchema: z.ZodObject<{
9774
9814
  } | undefined;
9775
9815
  concept?: string | undefined;
9776
9816
  mirror?: string | undefined;
9817
+ initImage?: string | undefined;
9818
+ initImageStrength?: number | undefined;
9777
9819
  terrainReferences?: {
9778
9820
  lower?: string | undefined;
9779
9821
  upper?: string | undefined;
@@ -12044,6 +12086,17 @@ declare const ManifestInputSchema: z.ZodObject<{
12044
12086
  * (a sword hand, a parted fringe) comes out the other way round.
12045
12087
  */
12046
12088
  mirror: z.ZodOptional<z.ZodString>;
12089
+ /**
12090
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
12091
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
12092
+ * instead of starting from nothing.
12093
+ */
12094
+ initImage: z.ZodOptional<z.ZodString>;
12095
+ /**
12096
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
12097
+ * PixelLab's default is 300.
12098
+ */
12099
+ initImageStrength: z.ZodOptional<z.ZodNumber>;
12047
12100
  /**
12048
12101
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
12049
12102
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -12312,6 +12365,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12312
12365
  } | undefined;
12313
12366
  concept?: string | undefined;
12314
12367
  mirror?: string | undefined;
12368
+ initImage?: string | undefined;
12369
+ initImageStrength?: number | undefined;
12315
12370
  terrainReferences?: {
12316
12371
  lower?: string | undefined;
12317
12372
  upper?: string | undefined;
@@ -12485,6 +12540,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12485
12540
  } | undefined;
12486
12541
  concept?: string | undefined;
12487
12542
  mirror?: string | undefined;
12543
+ initImage?: string | undefined;
12544
+ initImageStrength?: number | undefined;
12488
12545
  terrainReferences?: {
12489
12546
  lower?: string | undefined;
12490
12547
  upper?: string | undefined;
@@ -12664,6 +12721,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12664
12721
  } | undefined;
12665
12722
  concept?: string | undefined;
12666
12723
  mirror?: string | undefined;
12724
+ initImage?: string | undefined;
12725
+ initImageStrength?: number | undefined;
12667
12726
  terrainReferences?: {
12668
12727
  lower?: string | undefined;
12669
12728
  upper?: string | undefined;
@@ -12837,6 +12896,8 @@ declare const ManifestInputSchema: z.ZodObject<{
12837
12896
  } | undefined;
12838
12897
  concept?: string | undefined;
12839
12898
  mirror?: string | undefined;
12899
+ initImage?: string | undefined;
12900
+ initImageStrength?: number | undefined;
12840
12901
  terrainReferences?: {
12841
12902
  lower?: string | undefined;
12842
12903
  upper?: string | undefined;
@@ -13218,6 +13279,8 @@ declare const ManifestInputSchema: z.ZodObject<{
13218
13279
  } | undefined;
13219
13280
  concept?: string | undefined;
13220
13281
  mirror?: string | undefined;
13282
+ initImage?: string | undefined;
13283
+ initImageStrength?: number | undefined;
13221
13284
  terrainReferences?: {
13222
13285
  lower?: string | undefined;
13223
13286
  upper?: string | undefined;
@@ -13594,6 +13657,8 @@ declare const ManifestInputSchema: z.ZodObject<{
13594
13657
  } | undefined;
13595
13658
  concept?: string | undefined;
13596
13659
  mirror?: string | undefined;
13660
+ initImage?: string | undefined;
13661
+ initImageStrength?: number | undefined;
13597
13662
  terrainReferences?: {
13598
13663
  lower?: string | undefined;
13599
13664
  upper?: string | undefined;
@@ -17214,6 +17279,10 @@ interface ResolvedSpec {
17214
17279
  terrainPlatformThickness?: number;
17215
17280
  terrainLowerWalkable?: boolean;
17216
17281
  terrainUpperWalkable?: boolean;
17282
+ /** `pixflux`, `map` and `isometricTile`: the image the drawing starts from, hashed at resolve time. */
17283
+ initImage?: ResolvedTerrainReference & {
17284
+ strength?: number;
17285
+ };
17217
17286
  /** `terrain` generator only: reference PNGs per terrain, hashed at resolve time. A missing file has no hash. */
17218
17287
  terrainReferences?: Partial<Record<"lower" | "upper" | "transition", ResolvedTerrainReference>>;
17219
17288
  terrainTransitionSize?: number;
@@ -20589,6 +20658,9 @@ declare class PixelLabClient {
20589
20658
  outline?: string;
20590
20659
  shading?: string;
20591
20660
  detail?: string;
20661
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20662
+ initImage?: Base64Image;
20663
+ initImageStrength?: number;
20592
20664
  seed?: number;
20593
20665
  /**
20594
20666
  * Style matching: the scene the object should match, and where in it
@@ -20753,6 +20825,9 @@ declare class PixelLabClient {
20753
20825
  outline?: string;
20754
20826
  shading?: string;
20755
20827
  detail?: string;
20828
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20829
+ initImage?: Base64Image;
20830
+ initImageStrength?: number;
20756
20831
  seed?: number;
20757
20832
  }): Promise<{
20758
20833
  tile_id: string;
@@ -20850,6 +20925,9 @@ declare class PixelLabClient {
20850
20925
  height: number;
20851
20926
  noBackground?: boolean;
20852
20927
  paletteSwatchBase64?: string;
20928
+ /** A PNG to start from, and how strongly it holds (1-999; the API default is 300). */
20929
+ initImage?: Base64Image;
20930
+ initImageStrength?: number;
20853
20931
  seed?: number;
20854
20932
  }): Promise<{
20855
20933
  png: Buffer;
package/dist/index.js CHANGED
@@ -1347,6 +1347,17 @@ var AssetSchema = z.object({
1347
1347
  * (a sword hand, a parted fringe) comes out the other way round.
1348
1348
  */
1349
1349
  mirror: z.string().min(1).optional(),
1350
+ /**
1351
+ * `pixflux`, `map` and `isometricTile` styles: a PNG to start the drawing
1352
+ * from, relative to the manifest. PixelLab reworks it toward the prompt
1353
+ * instead of starting from nothing.
1354
+ */
1355
+ initImage: z.string().min(1).optional(),
1356
+ /**
1357
+ * With `initImage`: how strongly the starting image holds, 1 to 999.
1358
+ * PixelLab's default is 300.
1359
+ */
1360
+ initImageStrength: z.number().int().min(1).max(999).optional(),
1350
1361
  /**
1351
1362
  * `terrain` styles only: a PNG per terrain for PixelLab to take that
1352
1363
  * terrain's look from, paths relative to the manifest. Top-down sets
@@ -1410,6 +1421,13 @@ var AssetSchema = z.object({
1410
1421
  path: [shapes[1]]
1411
1422
  });
1412
1423
  }
1424
+ if (asset.initImageStrength !== void 0 && !asset.initImage) {
1425
+ context.addIssue({
1426
+ code: z.ZodIssueCode.custom,
1427
+ message: "initImageStrength sets how strongly initImage holds; add an initImage or drop it",
1428
+ path: ["initImageStrength"]
1429
+ });
1430
+ }
1413
1431
  for (const shape of ["derive", "external"]) {
1414
1432
  if (asset[shape] && (asset.source || Object.keys(asset.sourceByStyle).length)) {
1415
1433
  context.addIssue({
@@ -2526,6 +2544,10 @@ var PixelLabClient = class {
2526
2544
  if (args.outline) body.outline = args.outline;
2527
2545
  if (args.shading) body.shading = args.shading;
2528
2546
  if (args.detail) body.detail = args.detail;
2547
+ if (args.initImage) {
2548
+ body.init_image = { type: "base64", base64: args.initImage.base64, format: args.initImage.format };
2549
+ if (args.initImageStrength != null) body.init_image_strength = args.initImageStrength;
2550
+ }
2529
2551
  if (args.seed != null) body.seed = args.seed;
2530
2552
  if (args.scene) {
2531
2553
  const encode = (image) => ({ type: "base64", base64: image.base64, format: image.format });
@@ -2694,6 +2716,10 @@ var PixelLabClient = class {
2694
2716
  if (args.outline) body.outline = args.outline;
2695
2717
  if (args.shading) body.shading = args.shading;
2696
2718
  if (args.detail) body.detail = args.detail;
2719
+ if (args.initImage) {
2720
+ body.init_image = { type: "base64", base64: args.initImage.base64, format: args.initImage.format };
2721
+ if (args.initImageStrength != null) body.init_image_strength = args.initImageStrength;
2722
+ }
2697
2723
  if (args.seed != null) body.seed = args.seed;
2698
2724
  return validateResponse(
2699
2725
  IsometricTileSubmitSchema,
@@ -2818,6 +2844,10 @@ var PixelLabClient = class {
2818
2844
  if (args.paletteSwatchBase64) {
2819
2845
  body.color_image = { type: "base64", base64: args.paletteSwatchBase64, format: "png" };
2820
2846
  }
2847
+ if (args.initImage) {
2848
+ body.init_image = { type: "base64", base64: args.initImage.base64, format: args.initImage.format };
2849
+ if (args.initImageStrength != null) body.init_image_strength = args.initImageStrength;
2850
+ }
2821
2851
  if (args.seed != null) body.seed = args.seed;
2822
2852
  const res = validateResponse(
2823
2853
  PixfluxResponseSchema,
@@ -4641,6 +4671,8 @@ function specHash(spec, styleImageHashes, providerOptionIdentity = spec.provider
4641
4671
  terrainEnhance: spec.terrainEnhance,
4642
4672
  terrainPlatformThickness: spec.terrainPlatformThickness,
4643
4673
  // Reference images enter as their bytes' hashes, never their paths.
4674
+ // The starting image by its bytes, with its strength only when set.
4675
+ initImage: spec.initImage ? { sha256: spec.initImage.sha256, strength: spec.initImage.strength } : void 0,
4644
4676
  terrainReferences: spec.terrainReferences && Object.keys(spec.terrainReferences).length ? Object.fromEntries(
4645
4677
  ["lower", "upper", "transition"].flatMap((side) => {
4646
4678
  const reference = spec.terrainReferences[side];
@@ -7082,7 +7114,8 @@ var PixelLabProvider = class _PixelLabProvider {
7082
7114
  height: spec.height,
7083
7115
  noBackground: spec.noBackground,
7084
7116
  paletteSwatchBase64: swatch,
7085
- seed: spec.seed
7117
+ seed: spec.seed,
7118
+ ...await initImageArgs(spec)
7086
7119
  });
7087
7120
  const jobId = randomUUID();
7088
7121
  writeFileSync(path3.join(_PixelLabProvider.cacheDir(), `${jobId}.png`), png);
@@ -7195,7 +7228,8 @@ var PixelLabProvider = class _PixelLabProvider {
7195
7228
  outline: spec.outline,
7196
7229
  shading: spec.shading,
7197
7230
  detail: spec.detail,
7198
- seed: spec.seed
7231
+ seed: spec.seed,
7232
+ ...await initImageArgs(spec)
7199
7233
  });
7200
7234
  return { jobId: res2.tile_id, metadata: { backgroundJobId: res2.background_job_id } };
7201
7235
  }
@@ -7239,6 +7273,7 @@ var PixelLabProvider = class _PixelLabProvider {
7239
7273
  shading: spec.shading,
7240
7274
  detail: spec.detail,
7241
7275
  seed: spec.seed,
7276
+ ...await initImageArgs(spec),
7242
7277
  scene: spec.scene ? mapScenePayload(spec) : void 0
7243
7278
  });
7244
7279
  return { jobId: res.object_id, metadata: { backgroundJobId: res.background_job_id } };
@@ -8367,6 +8402,16 @@ function sendsTargetPalette(spec) {
8367
8402
  return false;
8368
8403
  }
8369
8404
  }
8405
+ async function initImageArgs(spec) {
8406
+ const init = spec.initImage;
8407
+ if (!init) return {};
8408
+ if (!existsSync3(init.file)) throw new Error(`init image is missing: ${init.file}`);
8409
+ const bytes = readFileSync(init.file);
8410
+ if (sha256(bytes) !== init.sha256) {
8411
+ throw new Error(`init image changed after the manifest was resolved: ${init.file}; run the command again`);
8412
+ }
8413
+ return { initImage: { base64: bytes.toString("base64"), format: "png" }, ...init.strength == null ? {} : { initImageStrength: init.strength } };
8414
+ }
8370
8415
  async function terrainReferenceImage(spec, side) {
8371
8416
  const reference = spec.terrainReferences?.[side];
8372
8417
  if (!reference) return void 0;
@@ -12105,6 +12150,23 @@ async function resolveSpecs(loaded, filter) {
12105
12150
  }
12106
12151
  resolved.terrainConnect = links;
12107
12152
  }
12153
+ if (asset.initImage) {
12154
+ if (!["pixflux", "map", "isometricTile"].includes(resolved.generator)) {
12155
+ throw new Error(
12156
+ `assets.${assetId}.initImage: a starting image is taken by pixflux, map and isometricTile styles; style "${styleId}" uses "${resolved.generator}"`
12157
+ );
12158
+ }
12159
+ const file = path8.resolve(root, asset.initImage);
12160
+ const image = await optionalRevisionImage(file, "init image", "png");
12161
+ if (!image) throw new Error(`assets.${assetId}.initImage: ${asset.initImage} is missing or not a PNG`);
12162
+ resolved.initImage = {
12163
+ file,
12164
+ sha256: image?.hash ?? null,
12165
+ width: image?.width ?? null,
12166
+ height: image?.height ?? null,
12167
+ ...asset.initImageStrength == null ? {} : { strength: asset.initImageStrength }
12168
+ };
12169
+ }
12108
12170
  if (asset.terrainReferences) {
12109
12171
  if (resolved.generator !== "terrain") {
12110
12172
  throw new Error(`assets.${assetId}.terrainReferences: only a terrain set takes terrain references; style "${styleId}" uses "${resolved.generator}"`);