pixelkiln 0.6.0 → 0.7.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/PROVIDERS.md +80 -50
- package/README.md +24 -13
- package/dist/cli.js +1347 -897
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +694 -242
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +95 -5
- package/dist/index.d.ts +95 -5
- package/dist/index.js +655 -204
- package/dist/index.js.map +1 -1
- package/docs/AGENTS.md +7 -5
- package/docs/ARCHITECTURE.md +15 -6
- package/docs/CLI.md +6 -4
- package/docs/COMFYUI.md +191 -0
- package/docs/GETTING_STARTED.md +14 -7
- package/docs/LIBRARY.md +9 -7
- package/docs/MANIFEST.md +54 -8
- package/docs/PROVIDER_BENCHMARK.md +46 -8
- package/docs/README.md +3 -2
- package/docs/RETRO_DIFFUSION.md +1 -1
- package/examples/comfyui/README.md +24 -0
- package/examples/comfyui/pixelkiln.manifest.json +35 -0
- package/examples/comfyui/workflow-api.json +59 -0
- package/package.json +2 -1
- package/schema/manifest.schema.json +4 -4
- package/skills/pixelkiln/SKILL.md +5 -3
- package/skills/pixelkiln/references/comfyui.md +46 -0
- package/skills/pixelkiln/references/mixed-providers.md +15 -7
package/dist/index.d.cts
CHANGED
|
@@ -53,6 +53,17 @@ interface PollContext {
|
|
|
53
53
|
}
|
|
54
54
|
/** Provider-owned, JSON-serializable details needed by downstream exporters. */
|
|
55
55
|
type ProviderMetadata = Record<string, unknown>;
|
|
56
|
+
interface ProviderOptionContext {
|
|
57
|
+
/** Absolute directory containing the manifest. */
|
|
58
|
+
root: string;
|
|
59
|
+
styleId: string;
|
|
60
|
+
}
|
|
61
|
+
interface ResolvedProviderOptions {
|
|
62
|
+
/** Runtime options passed to estimate, validate, and submit. */
|
|
63
|
+
options: Record<string, unknown>;
|
|
64
|
+
/** Stable JSON value hashed instead of runtime-only data when present. */
|
|
65
|
+
identity?: unknown;
|
|
66
|
+
}
|
|
56
67
|
/** Terminal and non-terminal states a queued job can be observed in. */
|
|
57
68
|
type JobState = {
|
|
58
69
|
status: "processing";
|
|
@@ -61,6 +72,7 @@ type JobState = {
|
|
|
61
72
|
} | {
|
|
62
73
|
status: "review";
|
|
63
74
|
candidateUrls: string[];
|
|
75
|
+
metadata?: ProviderMetadata;
|
|
64
76
|
} | {
|
|
65
77
|
status: "ready";
|
|
66
78
|
objectId: string;
|
|
@@ -131,6 +143,12 @@ declare const DEFAULT_RATE_LIMIT: RateLimit;
|
|
|
131
143
|
*/
|
|
132
144
|
interface Provider {
|
|
133
145
|
readonly id: string;
|
|
146
|
+
/**
|
|
147
|
+
* Resolve provider-owned local files before spec hashing. This must remain
|
|
148
|
+
* offline and return JSON-serializable data. It lets adapters hash file
|
|
149
|
+
* content rather than a machine-specific path.
|
|
150
|
+
*/
|
|
151
|
+
resolveOptions?(options: Record<string, unknown>, context: ProviderOptionContext): Promise<ResolvedProviderOptions>;
|
|
134
152
|
/** False for a generator this backend cannot express (e.g. non-square). */
|
|
135
153
|
supports(generator: Generator): boolean;
|
|
136
154
|
/** Never performs I/O — `plan` must stay free and offline. */
|
|
@@ -161,6 +179,8 @@ interface Provider {
|
|
|
161
179
|
download(url: string): Promise<Buffer>;
|
|
162
180
|
/** Query an authoritative account balance when the service exposes one. */
|
|
163
181
|
balance?(): Promise<BalanceInfo>;
|
|
182
|
+
/** Read-only connectivity probe for providers without a balance endpoint. */
|
|
183
|
+
checkConnection?(): Promise<void>;
|
|
164
184
|
/** Free-form labels on the remote asset. Absent if unsupported. */
|
|
165
185
|
setTags?(objectId: string, tags: string[]): Promise<void>;
|
|
166
186
|
/** Walk every asset on the account. Required by `adopt` and `salvage`. */
|
|
@@ -295,7 +315,7 @@ declare function generationCost(width: number, height: number, generator?: Gener
|
|
|
295
315
|
declare function tilesCost(tileSize: number, variations: number): number;
|
|
296
316
|
declare const StyleSchema: z.ZodEffects<z.ZodObject<{
|
|
297
317
|
generator: z.ZodDefault<z.ZodEnum<["1dir", "map", "pixflux", "tiles", "animation"]>>;
|
|
298
|
-
/** Square edge length
|
|
318
|
+
/** Square edge length. The active provider owns its exact limit. */
|
|
299
319
|
size: z.ZodOptional<z.ZodNumber>;
|
|
300
320
|
view: z.ZodOptional<z.ZodString>;
|
|
301
321
|
/** Appended to every asset prompt in this style. Where the look is defined. */
|
|
@@ -628,7 +648,7 @@ declare const ManifestSchema: z.ZodObject<{
|
|
|
628
648
|
provider: z.ZodDefault<z.ZodString>;
|
|
629
649
|
styles: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
630
650
|
generator: z.ZodDefault<z.ZodEnum<["1dir", "map", "pixflux", "tiles", "animation"]>>;
|
|
631
|
-
/** Square edge length
|
|
651
|
+
/** Square edge length. The active provider owns its exact limit. */
|
|
632
652
|
size: z.ZodOptional<z.ZodNumber>;
|
|
633
653
|
view: z.ZodOptional<z.ZodString>;
|
|
634
654
|
/** Appended to every asset prompt in this style. Where the look is defined. */
|
|
@@ -1789,6 +1809,76 @@ declare class RetroDiffusionProvider implements Provider {
|
|
|
1789
1809
|
balance(): Promise<BalanceInfo>;
|
|
1790
1810
|
}
|
|
1791
1811
|
|
|
1812
|
+
type JsonObject = Record<string, unknown>;
|
|
1813
|
+
type ComfyWorkflow = Record<string, {
|
|
1814
|
+
class_type: string;
|
|
1815
|
+
inputs: JsonObject;
|
|
1816
|
+
[key: string]: unknown;
|
|
1817
|
+
}>;
|
|
1818
|
+
interface ComfyUIBinding {
|
|
1819
|
+
nodeId: string;
|
|
1820
|
+
input: string;
|
|
1821
|
+
}
|
|
1822
|
+
interface ComfyUIBindings {
|
|
1823
|
+
prompt: ComfyUIBinding;
|
|
1824
|
+
width: ComfyUIBinding;
|
|
1825
|
+
height: ComfyUIBinding;
|
|
1826
|
+
batchSize: ComfyUIBinding;
|
|
1827
|
+
seed?: ComfyUIBinding;
|
|
1828
|
+
}
|
|
1829
|
+
/** Options stored under `providerOptions.comfyui` in a manifest style. */
|
|
1830
|
+
interface ComfyUIOptions {
|
|
1831
|
+
/** ComfyUI API-format workflow JSON, relative to the manifest. */
|
|
1832
|
+
workflowFile: string;
|
|
1833
|
+
/** Node whose history output contains the final `images` array. */
|
|
1834
|
+
outputNodeId: string;
|
|
1835
|
+
/** Expected final images from the output node. */
|
|
1836
|
+
numImages?: number;
|
|
1837
|
+
/** Exact workflow inputs PixelKiln is allowed to replace. */
|
|
1838
|
+
bindings: ComfyUIBindings;
|
|
1839
|
+
}
|
|
1840
|
+
interface ComfyImage {
|
|
1841
|
+
filename: string;
|
|
1842
|
+
subfolder: string;
|
|
1843
|
+
type: "output";
|
|
1844
|
+
}
|
|
1845
|
+
declare class ComfyUIClient {
|
|
1846
|
+
private readonly request;
|
|
1847
|
+
readonly baseUrl: string;
|
|
1848
|
+
constructor(baseUrl?: string, request?: typeof fetch);
|
|
1849
|
+
checkConnection(): Promise<void>;
|
|
1850
|
+
submit(workflow: ComfyWorkflow): Promise<string>;
|
|
1851
|
+
history(promptId: string): Promise<unknown>;
|
|
1852
|
+
viewUrl(image: ComfyImage): string;
|
|
1853
|
+
download(source: string): Promise<Buffer>;
|
|
1854
|
+
private endpoint;
|
|
1855
|
+
private json;
|
|
1856
|
+
}
|
|
1857
|
+
/** Self-hosted ComfyUI workflow adapter. */
|
|
1858
|
+
declare class ComfyUIProvider implements Provider {
|
|
1859
|
+
private readonly client;
|
|
1860
|
+
readonly id = "comfyui";
|
|
1861
|
+
constructor(client?: ComfyUIClient);
|
|
1862
|
+
static fromEnv(): ComfyUIProvider;
|
|
1863
|
+
static forOffline(): ComfyUIProvider;
|
|
1864
|
+
static forDownloads(): ComfyUIProvider;
|
|
1865
|
+
resolveOptions(value: Record<string, unknown>, context: ProviderOptionContext): Promise<ResolvedProviderOptions>;
|
|
1866
|
+
supports(generator: Generator): boolean;
|
|
1867
|
+
estimate(spec: ResolvedSpec): CostEstimate;
|
|
1868
|
+
validate(spec: ResolvedSpec, styleImages: ResolvedStyleImage[]): void;
|
|
1869
|
+
rateLimit(): RateLimit;
|
|
1870
|
+
submit(spec: ResolvedSpec, styleImages: ResolvedStyleImage[]): Promise<{
|
|
1871
|
+
jobId: string;
|
|
1872
|
+
}>;
|
|
1873
|
+
poll(jobId: string, _generator: Generator, context?: PollContext): Promise<JobState>;
|
|
1874
|
+
selectCandidate(jobId: string, index: number): Promise<{
|
|
1875
|
+
objectId: string;
|
|
1876
|
+
sourceUrl: string | null;
|
|
1877
|
+
}>;
|
|
1878
|
+
download(url: string): Promise<Buffer>;
|
|
1879
|
+
checkConnection(): Promise<void>;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1792
1882
|
/**
|
|
1793
1883
|
* An in-memory Provider for tests.
|
|
1794
1884
|
*
|
|
@@ -1899,7 +1989,7 @@ declare function resolveSpecs(loaded: LoadedManifest, filter?: {
|
|
|
1899
1989
|
styles?: string[];
|
|
1900
1990
|
assets?: string[];
|
|
1901
1991
|
/** Optional provider makes offline plan cost/candidate estimates adapter-owned. */
|
|
1902
|
-
provider?: Pick<Provider, "supports" | "estimate" | "validate" | "id">;
|
|
1992
|
+
provider?: Pick<Provider, "supports" | "estimate" | "validate" | "resolveOptions" | "id">;
|
|
1903
1993
|
}): Promise<ResolvedSpec[]>;
|
|
1904
1994
|
/** Reference image bytes and measured dimensions, in manifest order. */
|
|
1905
1995
|
declare function resolveStyleImages(loaded: LoadedManifest, styleId: string): Promise<ResolvedStyleImage[]>;
|
|
@@ -1947,7 +2037,7 @@ declare function sha256File(path: string): Promise<string>;
|
|
|
1947
2037
|
* invites a full regeneration of art that never changed. Adding `palette`
|
|
1948
2038
|
* unconditionally did exactly that once already.
|
|
1949
2039
|
*/
|
|
1950
|
-
declare function specHash(spec: Omit<ResolvedSpec, "specHash" | "root" | "outFile" | "source" | "tags">, styleImageHashes: string[]): string;
|
|
2040
|
+
declare function specHash(spec: Omit<ResolvedSpec, "specHash" | "root" | "outFile" | "source" | "tags">, styleImageHashes: string[], providerOptionIdentity?: unknown): string;
|
|
1951
2041
|
|
|
1952
2042
|
/** One lockfile output with the identity consumers should expose publicly. */
|
|
1953
2043
|
interface ResolvedOutput extends LockOutput {
|
|
@@ -2995,4 +3085,4 @@ interface WorkspaceStatusReport {
|
|
|
2995
3085
|
*/
|
|
2996
3086
|
declare function workspaceStatus(ws: Workspace, dir: string): Promise<WorkspaceStatusReport>;
|
|
2997
3087
|
|
|
2998
|
-
export { type AdoptResult, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, type CacheHealthOptions, type CacheHealthReport, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_RATE_LIMIT, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type Generator, GeneratorSchema, type GenericTileset, type JobState, type LoadedManifest, type Lock, type LockEntry, LockEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, type PackedFrame, type PackedSheet, type PackedSource, type PickResult, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type Provider, type ProviderFactory, type ProviderMetadata, type ProviderMode, type RateLimit, type RemoteAsset, type RemoteHashCacheHealth, type ResolvedOutput, type ResolvedSpec, type ResolvedStyleImage, type RetroDiffusionOptions, RetroDiffusionProvider, type SalvageAction, type SalvageResult, type ScannedAsset, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, StyleSchema, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyTags, auditStyle, availableProviders, backoffMs, buildManifest, buildPlan, cacheFileName, candidateCount, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createProvider, currentEntryOutputPath, currentOutputPath, detectMediaType, doctor, evaluateAudit, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, findOrphans, formatCost, generationCost, groupOrphansByStyle, hex, idFromPrompt, imageMetadata, inspectCaches, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, mediaExtension, mediaTypeFromExtension, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeTileRules, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pngSize, poll, portableOutputPath, primaryOutput, providerFactory, pushTags, registerProvider, remove, renderSalvageSheet, renderSheet, requireBalance, requireDelete, requireList, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, retryAfterMs, runPicker, runSalvage, saveLock, saveWorkspace, scanAssets, selectEntryOutput, sha256, sha256File, shouldRetry, slugify, specHash, spendByUnit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };
|
|
3088
|
+
export { type AdoptResult, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, type CacheHealthOptions, type CacheHealthReport, type ComfyUIBinding, type ComfyUIBindings, type ComfyUIOptions, ComfyUIProvider, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_RATE_LIMIT, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type Generator, GeneratorSchema, type GenericTileset, type JobState, type LoadedManifest, type Lock, type LockEntry, LockEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, type PackedFrame, type PackedSheet, type PackedSource, type PickResult, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type Provider, type ProviderFactory, type ProviderMetadata, type ProviderMode, type ProviderOptionContext, type RateLimit, type RemoteAsset, type RemoteHashCacheHealth, type ResolvedOutput, type ResolvedProviderOptions, type ResolvedSpec, type ResolvedStyleImage, type RetroDiffusionOptions, RetroDiffusionProvider, type SalvageAction, type SalvageResult, type ScannedAsset, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, StyleSchema, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyTags, auditStyle, availableProviders, backoffMs, buildManifest, buildPlan, cacheFileName, candidateCount, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createProvider, currentEntryOutputPath, currentOutputPath, detectMediaType, doctor, evaluateAudit, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, findOrphans, formatCost, generationCost, groupOrphansByStyle, hex, idFromPrompt, imageMetadata, inspectCaches, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, mediaExtension, mediaTypeFromExtension, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeTileRules, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pngSize, poll, portableOutputPath, primaryOutput, providerFactory, pushTags, registerProvider, remove, renderSalvageSheet, renderSheet, requireBalance, requireDelete, requireList, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, retryAfterMs, runPicker, runSalvage, saveLock, saveWorkspace, scanAssets, selectEntryOutput, sha256, sha256File, shouldRetry, slugify, specHash, spendByUnit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,17 @@ interface PollContext {
|
|
|
53
53
|
}
|
|
54
54
|
/** Provider-owned, JSON-serializable details needed by downstream exporters. */
|
|
55
55
|
type ProviderMetadata = Record<string, unknown>;
|
|
56
|
+
interface ProviderOptionContext {
|
|
57
|
+
/** Absolute directory containing the manifest. */
|
|
58
|
+
root: string;
|
|
59
|
+
styleId: string;
|
|
60
|
+
}
|
|
61
|
+
interface ResolvedProviderOptions {
|
|
62
|
+
/** Runtime options passed to estimate, validate, and submit. */
|
|
63
|
+
options: Record<string, unknown>;
|
|
64
|
+
/** Stable JSON value hashed instead of runtime-only data when present. */
|
|
65
|
+
identity?: unknown;
|
|
66
|
+
}
|
|
56
67
|
/** Terminal and non-terminal states a queued job can be observed in. */
|
|
57
68
|
type JobState = {
|
|
58
69
|
status: "processing";
|
|
@@ -61,6 +72,7 @@ type JobState = {
|
|
|
61
72
|
} | {
|
|
62
73
|
status: "review";
|
|
63
74
|
candidateUrls: string[];
|
|
75
|
+
metadata?: ProviderMetadata;
|
|
64
76
|
} | {
|
|
65
77
|
status: "ready";
|
|
66
78
|
objectId: string;
|
|
@@ -131,6 +143,12 @@ declare const DEFAULT_RATE_LIMIT: RateLimit;
|
|
|
131
143
|
*/
|
|
132
144
|
interface Provider {
|
|
133
145
|
readonly id: string;
|
|
146
|
+
/**
|
|
147
|
+
* Resolve provider-owned local files before spec hashing. This must remain
|
|
148
|
+
* offline and return JSON-serializable data. It lets adapters hash file
|
|
149
|
+
* content rather than a machine-specific path.
|
|
150
|
+
*/
|
|
151
|
+
resolveOptions?(options: Record<string, unknown>, context: ProviderOptionContext): Promise<ResolvedProviderOptions>;
|
|
134
152
|
/** False for a generator this backend cannot express (e.g. non-square). */
|
|
135
153
|
supports(generator: Generator): boolean;
|
|
136
154
|
/** Never performs I/O — `plan` must stay free and offline. */
|
|
@@ -161,6 +179,8 @@ interface Provider {
|
|
|
161
179
|
download(url: string): Promise<Buffer>;
|
|
162
180
|
/** Query an authoritative account balance when the service exposes one. */
|
|
163
181
|
balance?(): Promise<BalanceInfo>;
|
|
182
|
+
/** Read-only connectivity probe for providers without a balance endpoint. */
|
|
183
|
+
checkConnection?(): Promise<void>;
|
|
164
184
|
/** Free-form labels on the remote asset. Absent if unsupported. */
|
|
165
185
|
setTags?(objectId: string, tags: string[]): Promise<void>;
|
|
166
186
|
/** Walk every asset on the account. Required by `adopt` and `salvage`. */
|
|
@@ -295,7 +315,7 @@ declare function generationCost(width: number, height: number, generator?: Gener
|
|
|
295
315
|
declare function tilesCost(tileSize: number, variations: number): number;
|
|
296
316
|
declare const StyleSchema: z.ZodEffects<z.ZodObject<{
|
|
297
317
|
generator: z.ZodDefault<z.ZodEnum<["1dir", "map", "pixflux", "tiles", "animation"]>>;
|
|
298
|
-
/** Square edge length
|
|
318
|
+
/** Square edge length. The active provider owns its exact limit. */
|
|
299
319
|
size: z.ZodOptional<z.ZodNumber>;
|
|
300
320
|
view: z.ZodOptional<z.ZodString>;
|
|
301
321
|
/** Appended to every asset prompt in this style. Where the look is defined. */
|
|
@@ -628,7 +648,7 @@ declare const ManifestSchema: z.ZodObject<{
|
|
|
628
648
|
provider: z.ZodDefault<z.ZodString>;
|
|
629
649
|
styles: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
630
650
|
generator: z.ZodDefault<z.ZodEnum<["1dir", "map", "pixflux", "tiles", "animation"]>>;
|
|
631
|
-
/** Square edge length
|
|
651
|
+
/** Square edge length. The active provider owns its exact limit. */
|
|
632
652
|
size: z.ZodOptional<z.ZodNumber>;
|
|
633
653
|
view: z.ZodOptional<z.ZodString>;
|
|
634
654
|
/** Appended to every asset prompt in this style. Where the look is defined. */
|
|
@@ -1789,6 +1809,76 @@ declare class RetroDiffusionProvider implements Provider {
|
|
|
1789
1809
|
balance(): Promise<BalanceInfo>;
|
|
1790
1810
|
}
|
|
1791
1811
|
|
|
1812
|
+
type JsonObject = Record<string, unknown>;
|
|
1813
|
+
type ComfyWorkflow = Record<string, {
|
|
1814
|
+
class_type: string;
|
|
1815
|
+
inputs: JsonObject;
|
|
1816
|
+
[key: string]: unknown;
|
|
1817
|
+
}>;
|
|
1818
|
+
interface ComfyUIBinding {
|
|
1819
|
+
nodeId: string;
|
|
1820
|
+
input: string;
|
|
1821
|
+
}
|
|
1822
|
+
interface ComfyUIBindings {
|
|
1823
|
+
prompt: ComfyUIBinding;
|
|
1824
|
+
width: ComfyUIBinding;
|
|
1825
|
+
height: ComfyUIBinding;
|
|
1826
|
+
batchSize: ComfyUIBinding;
|
|
1827
|
+
seed?: ComfyUIBinding;
|
|
1828
|
+
}
|
|
1829
|
+
/** Options stored under `providerOptions.comfyui` in a manifest style. */
|
|
1830
|
+
interface ComfyUIOptions {
|
|
1831
|
+
/** ComfyUI API-format workflow JSON, relative to the manifest. */
|
|
1832
|
+
workflowFile: string;
|
|
1833
|
+
/** Node whose history output contains the final `images` array. */
|
|
1834
|
+
outputNodeId: string;
|
|
1835
|
+
/** Expected final images from the output node. */
|
|
1836
|
+
numImages?: number;
|
|
1837
|
+
/** Exact workflow inputs PixelKiln is allowed to replace. */
|
|
1838
|
+
bindings: ComfyUIBindings;
|
|
1839
|
+
}
|
|
1840
|
+
interface ComfyImage {
|
|
1841
|
+
filename: string;
|
|
1842
|
+
subfolder: string;
|
|
1843
|
+
type: "output";
|
|
1844
|
+
}
|
|
1845
|
+
declare class ComfyUIClient {
|
|
1846
|
+
private readonly request;
|
|
1847
|
+
readonly baseUrl: string;
|
|
1848
|
+
constructor(baseUrl?: string, request?: typeof fetch);
|
|
1849
|
+
checkConnection(): Promise<void>;
|
|
1850
|
+
submit(workflow: ComfyWorkflow): Promise<string>;
|
|
1851
|
+
history(promptId: string): Promise<unknown>;
|
|
1852
|
+
viewUrl(image: ComfyImage): string;
|
|
1853
|
+
download(source: string): Promise<Buffer>;
|
|
1854
|
+
private endpoint;
|
|
1855
|
+
private json;
|
|
1856
|
+
}
|
|
1857
|
+
/** Self-hosted ComfyUI workflow adapter. */
|
|
1858
|
+
declare class ComfyUIProvider implements Provider {
|
|
1859
|
+
private readonly client;
|
|
1860
|
+
readonly id = "comfyui";
|
|
1861
|
+
constructor(client?: ComfyUIClient);
|
|
1862
|
+
static fromEnv(): ComfyUIProvider;
|
|
1863
|
+
static forOffline(): ComfyUIProvider;
|
|
1864
|
+
static forDownloads(): ComfyUIProvider;
|
|
1865
|
+
resolveOptions(value: Record<string, unknown>, context: ProviderOptionContext): Promise<ResolvedProviderOptions>;
|
|
1866
|
+
supports(generator: Generator): boolean;
|
|
1867
|
+
estimate(spec: ResolvedSpec): CostEstimate;
|
|
1868
|
+
validate(spec: ResolvedSpec, styleImages: ResolvedStyleImage[]): void;
|
|
1869
|
+
rateLimit(): RateLimit;
|
|
1870
|
+
submit(spec: ResolvedSpec, styleImages: ResolvedStyleImage[]): Promise<{
|
|
1871
|
+
jobId: string;
|
|
1872
|
+
}>;
|
|
1873
|
+
poll(jobId: string, _generator: Generator, context?: PollContext): Promise<JobState>;
|
|
1874
|
+
selectCandidate(jobId: string, index: number): Promise<{
|
|
1875
|
+
objectId: string;
|
|
1876
|
+
sourceUrl: string | null;
|
|
1877
|
+
}>;
|
|
1878
|
+
download(url: string): Promise<Buffer>;
|
|
1879
|
+
checkConnection(): Promise<void>;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1792
1882
|
/**
|
|
1793
1883
|
* An in-memory Provider for tests.
|
|
1794
1884
|
*
|
|
@@ -1899,7 +1989,7 @@ declare function resolveSpecs(loaded: LoadedManifest, filter?: {
|
|
|
1899
1989
|
styles?: string[];
|
|
1900
1990
|
assets?: string[];
|
|
1901
1991
|
/** Optional provider makes offline plan cost/candidate estimates adapter-owned. */
|
|
1902
|
-
provider?: Pick<Provider, "supports" | "estimate" | "validate" | "id">;
|
|
1992
|
+
provider?: Pick<Provider, "supports" | "estimate" | "validate" | "resolveOptions" | "id">;
|
|
1903
1993
|
}): Promise<ResolvedSpec[]>;
|
|
1904
1994
|
/** Reference image bytes and measured dimensions, in manifest order. */
|
|
1905
1995
|
declare function resolveStyleImages(loaded: LoadedManifest, styleId: string): Promise<ResolvedStyleImage[]>;
|
|
@@ -1947,7 +2037,7 @@ declare function sha256File(path: string): Promise<string>;
|
|
|
1947
2037
|
* invites a full regeneration of art that never changed. Adding `palette`
|
|
1948
2038
|
* unconditionally did exactly that once already.
|
|
1949
2039
|
*/
|
|
1950
|
-
declare function specHash(spec: Omit<ResolvedSpec, "specHash" | "root" | "outFile" | "source" | "tags">, styleImageHashes: string[]): string;
|
|
2040
|
+
declare function specHash(spec: Omit<ResolvedSpec, "specHash" | "root" | "outFile" | "source" | "tags">, styleImageHashes: string[], providerOptionIdentity?: unknown): string;
|
|
1951
2041
|
|
|
1952
2042
|
/** One lockfile output with the identity consumers should expose publicly. */
|
|
1953
2043
|
interface ResolvedOutput extends LockOutput {
|
|
@@ -2995,4 +3085,4 @@ interface WorkspaceStatusReport {
|
|
|
2995
3085
|
*/
|
|
2996
3086
|
declare function workspaceStatus(ws: Workspace, dir: string): Promise<WorkspaceStatusReport>;
|
|
2997
3087
|
|
|
2998
|
-
export { type AdoptResult, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, type CacheHealthOptions, type CacheHealthReport, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_RATE_LIMIT, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type Generator, GeneratorSchema, type GenericTileset, type JobState, type LoadedManifest, type Lock, type LockEntry, LockEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, type PackedFrame, type PackedSheet, type PackedSource, type PickResult, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type Provider, type ProviderFactory, type ProviderMetadata, type ProviderMode, type RateLimit, type RemoteAsset, type RemoteHashCacheHealth, type ResolvedOutput, type ResolvedSpec, type ResolvedStyleImage, type RetroDiffusionOptions, RetroDiffusionProvider, type SalvageAction, type SalvageResult, type ScannedAsset, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, StyleSchema, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyTags, auditStyle, availableProviders, backoffMs, buildManifest, buildPlan, cacheFileName, candidateCount, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createProvider, currentEntryOutputPath, currentOutputPath, detectMediaType, doctor, evaluateAudit, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, findOrphans, formatCost, generationCost, groupOrphansByStyle, hex, idFromPrompt, imageMetadata, inspectCaches, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, mediaExtension, mediaTypeFromExtension, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeTileRules, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pngSize, poll, portableOutputPath, primaryOutput, providerFactory, pushTags, registerProvider, remove, renderSalvageSheet, renderSheet, requireBalance, requireDelete, requireList, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, retryAfterMs, runPicker, runSalvage, saveLock, saveWorkspace, scanAssets, selectEntryOutput, sha256, sha256File, shouldRetry, slugify, specHash, spendByUnit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };
|
|
3088
|
+
export { type AdoptResult, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, type CacheHealthOptions, type CacheHealthReport, type ComfyUIBinding, type ComfyUIBindings, type ComfyUIOptions, ComfyUIProvider, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_RATE_LIMIT, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type Generator, GeneratorSchema, type GenericTileset, type JobState, type LoadedManifest, type Lock, type LockEntry, LockEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, type PackedFrame, type PackedSheet, type PackedSource, type PickResult, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type Provider, type ProviderFactory, type ProviderMetadata, type ProviderMode, type ProviderOptionContext, type RateLimit, type RemoteAsset, type RemoteHashCacheHealth, type ResolvedOutput, type ResolvedProviderOptions, type ResolvedSpec, type ResolvedStyleImage, type RetroDiffusionOptions, RetroDiffusionProvider, type SalvageAction, type SalvageResult, type ScannedAsset, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, StyleSchema, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyTags, auditStyle, availableProviders, backoffMs, buildManifest, buildPlan, cacheFileName, candidateCount, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createProvider, currentEntryOutputPath, currentOutputPath, detectMediaType, doctor, evaluateAudit, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, findOrphans, formatCost, generationCost, groupOrphansByStyle, hex, idFromPrompt, imageMetadata, inspectCaches, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, mediaExtension, mediaTypeFromExtension, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeTileRules, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pngSize, poll, portableOutputPath, primaryOutput, providerFactory, pushTags, registerProvider, remove, renderSalvageSheet, renderSheet, requireBalance, requireDelete, requireList, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, retryAfterMs, runPicker, runSalvage, saveLock, saveWorkspace, scanAssets, selectEntryOutput, sha256, sha256File, shouldRetry, slugify, specHash, spendByUnit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };
|