@civitai/orchestration-client 0.2.0 → 0.2.2

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.
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- import { client } from './client.gen';
2
+ import { client } from './client.gen.js';
3
3
  /**
4
4
  * Get blob by ID. This will redirect to a cacheable content URL.
5
5
  */
@@ -11997,6 +11997,141 @@ export declare const ZoeDepthEnvironment: {
11997
11997
  readonly OUTDOOR: 'outdoor';
11998
11998
  };
11999
11999
  export type ZoeDepthEnvironment = (typeof ZoeDepthEnvironment)[keyof typeof ZoeDepthEnvironment];
12000
+ export type KohyaTrainingInput = Omit<TrainingInput, 'engine'> & {
12001
+ /**
12002
+ * Any compatible SD1.5, SDXL (including Pony, Illustrious and NoobAI), FLUX.1 or Chroma checkpoint AIR.
12003
+ */
12004
+ model: string;
12005
+ /**
12006
+ * Number of saved checkpoints across the training run.
12007
+ */
12008
+ maxTrainEpochs: number;
12009
+ /**
12010
+ * Number of times each training image is repeated per dataset epoch.
12011
+ */
12012
+ numRepeats: number;
12013
+ /**
12014
+ * Images per optimizer step.
12015
+ */
12016
+ trainBatchSize: number;
12017
+ /**
12018
+ * Training resolution; defaults to 512 for SD1.5 and 1024 for other families.
12019
+ */
12020
+ resolution?: null | number;
12021
+ /**
12022
+ * Group images into aspect-ratio buckets.
12023
+ */
12024
+ enableBucket: boolean;
12025
+ /**
12026
+ * Shuffle comma-separated caption tokens during training.
12027
+ */
12028
+ shuffleCaption: boolean;
12029
+ /**
12030
+ * Leading caption tokens kept in place while shuffling.
12031
+ */
12032
+ keepTokens: number;
12033
+ /**
12034
+ * CLIP layer skip for SD1.5; other families use 1.
12035
+ */
12036
+ clipSkip: number;
12037
+ /**
12038
+ * Random horizontal image flips.
12039
+ */
12040
+ flipAugmentation: boolean;
12041
+ /**
12042
+ * Learning rate for the diffusion model LoRA.
12043
+ */
12044
+ unetLR: number;
12045
+ /**
12046
+ * Learning rate for text encoder LoRA modules.
12047
+ */
12048
+ textEncoderLR: number;
12049
+ /**
12050
+ * Learning-rate schedule over the total optimizer-step budget.
12051
+ */
12052
+ lrScheduler:
12053
+ | 'constant'
12054
+ | 'constant_with_warmup'
12055
+ | 'cosine'
12056
+ | 'cosine_with_restarts'
12057
+ | 'linear'
12058
+ | 'polynomial';
12059
+ /**
12060
+ * Number of cycles used by cosine_with_restarts; ignored by other schedulers.
12061
+ */
12062
+ lrSchedulerNumCycles: number;
12063
+ /**
12064
+ * Min-SNR loss weighting; defaults to 5 for SD models and 0 for flow models.
12065
+ */
12066
+ minSnrGamma?: null | number;
12067
+ /**
12068
+ * LoRA rank; must match ContinueFrom weights.
12069
+ */
12070
+ networkDim: number;
12071
+ /**
12072
+ * LoRA alpha; must match ContinueFrom weights.
12073
+ */
12074
+ networkAlpha: number;
12075
+ /**
12076
+ * Noise offset for SD training; flow models require 0.
12077
+ */
12078
+ noiseOffset: number;
12079
+ /**
12080
+ * Optimizer used for the LoRA parameters; names are case-insensitive.
12081
+ */
12082
+ optimizerType: 'AdamW' | 'AdamW8bit' | 'Adafactor' | 'Prodigy' | 'Lion' | 'Lion8bit';
12083
+ /**
12084
+ * Train text encoder LoRAs; must match ContinueFrom coverage. FLUX supports CLIP-L; Chroma does not support this option.
12085
+ */
12086
+ trainTextEncoder?: null | boolean;
12087
+ /**
12088
+ * Total optimizer steps; otherwise derived from epochs, repeats, declared image count and batch size. Supply an accurate count or explicit steps.
12089
+ */
12090
+ steps?: null | number;
12091
+ /**
12092
+ * Starts a new schedule from these LoRA weights. Worker handoffs restore full state automatically.
12093
+ */
12094
+ continueFrom?: null | string;
12095
+ /**
12096
+ * Optional FLUX CLIP-L resource override.
12097
+ */
12098
+ clipLModel?: null | string;
12099
+ /**
12100
+ * Optional FLUX or Chroma T5 text encoder resource override.
12101
+ */
12102
+ textEncoderModel?: null | string;
12103
+ /**
12104
+ * Optional VAE resource override.
12105
+ */
12106
+ vaeModel?: null | string;
12107
+ /**
12108
+ * Use FP8 base weights for FLUX or Chroma; defaults to true for these families.
12109
+ */
12110
+ fp8Base?: null | boolean;
12111
+ /**
12112
+ * Transformer blocks swapped to CPU for FLUX or Chroma; defaults to 18.
12113
+ */
12114
+ blocksToSwap?: null | number;
12115
+ /**
12116
+ * Random seed for training and generated samples.
12117
+ */
12118
+ seed: number;
12119
+ /**
12120
+ * What an epoch job records to its live trace stream (`output.epochs[].traceUrl`), which the consumer can tail
12121
+ * while the job runs.
12122
+ */
12123
+ trace: TrainingTraceMode;
12124
+ /**
12125
+ * Training objective override: true trains with v-prediction. Omit to detect checkpoint markers; unmarked checkpoints default to epsilon. Previews use their own checkpoint detection.
12126
+ */
12127
+ vParameterization?: null | boolean;
12128
+ /**
12129
+ * Training schedule override: true trains with zero terminal SNR. Omit to detect the checkpoint ztsnr marker. Previews use their own checkpoint detection.
12130
+ */
12131
+ zeroTerminalSnr?: null | boolean;
12132
+ readonly usesStepPricing: boolean;
12133
+ engine: 'kohya';
12134
+ };
12000
12135
  export type AiToolkitTrainingInputWritable = Omit<TrainingInputWritable2, 'engine'> & {
12001
12136
  ecosystem: string;
12002
12137
  /**
@@ -13492,6 +13627,140 @@ export type ZImageTurboAiToolkitTrainingInputWritable = Omit<
13492
13627
  */
13493
13628
  batchSize?: null | number;
13494
13629
  };
13630
+ export type KohyaTrainingInputWritable = Omit<TrainingInputWritable2, 'engine'> & {
13631
+ /**
13632
+ * Any compatible SD1.5, SDXL (including Pony, Illustrious and NoobAI), FLUX.1 or Chroma checkpoint AIR.
13633
+ */
13634
+ model: string;
13635
+ /**
13636
+ * Number of saved checkpoints across the training run.
13637
+ */
13638
+ maxTrainEpochs: number;
13639
+ /**
13640
+ * Number of times each training image is repeated per dataset epoch.
13641
+ */
13642
+ numRepeats: number;
13643
+ /**
13644
+ * Images per optimizer step.
13645
+ */
13646
+ trainBatchSize: number;
13647
+ /**
13648
+ * Training resolution; defaults to 512 for SD1.5 and 1024 for other families.
13649
+ */
13650
+ resolution?: null | number;
13651
+ /**
13652
+ * Group images into aspect-ratio buckets.
13653
+ */
13654
+ enableBucket: boolean;
13655
+ /**
13656
+ * Shuffle comma-separated caption tokens during training.
13657
+ */
13658
+ shuffleCaption: boolean;
13659
+ /**
13660
+ * Leading caption tokens kept in place while shuffling.
13661
+ */
13662
+ keepTokens: number;
13663
+ /**
13664
+ * CLIP layer skip for SD1.5; other families use 1.
13665
+ */
13666
+ clipSkip: number;
13667
+ /**
13668
+ * Random horizontal image flips.
13669
+ */
13670
+ flipAugmentation: boolean;
13671
+ /**
13672
+ * Learning rate for the diffusion model LoRA.
13673
+ */
13674
+ unetLR: number;
13675
+ /**
13676
+ * Learning rate for text encoder LoRA modules.
13677
+ */
13678
+ textEncoderLR: number;
13679
+ /**
13680
+ * Learning-rate schedule over the total optimizer-step budget.
13681
+ */
13682
+ lrScheduler:
13683
+ | 'constant'
13684
+ | 'constant_with_warmup'
13685
+ | 'cosine'
13686
+ | 'cosine_with_restarts'
13687
+ | 'linear'
13688
+ | 'polynomial';
13689
+ /**
13690
+ * Number of cycles used by cosine_with_restarts; ignored by other schedulers.
13691
+ */
13692
+ lrSchedulerNumCycles: number;
13693
+ /**
13694
+ * Min-SNR loss weighting; defaults to 5 for SD models and 0 for flow models.
13695
+ */
13696
+ minSnrGamma?: null | number;
13697
+ /**
13698
+ * LoRA rank; must match ContinueFrom weights.
13699
+ */
13700
+ networkDim: number;
13701
+ /**
13702
+ * LoRA alpha; must match ContinueFrom weights.
13703
+ */
13704
+ networkAlpha: number;
13705
+ /**
13706
+ * Noise offset for SD training; flow models require 0.
13707
+ */
13708
+ noiseOffset: number;
13709
+ /**
13710
+ * Optimizer used for the LoRA parameters; names are case-insensitive.
13711
+ */
13712
+ optimizerType: 'AdamW' | 'AdamW8bit' | 'Adafactor' | 'Prodigy' | 'Lion' | 'Lion8bit';
13713
+ /**
13714
+ * Train text encoder LoRAs; must match ContinueFrom coverage. FLUX supports CLIP-L; Chroma does not support this option.
13715
+ */
13716
+ trainTextEncoder?: null | boolean;
13717
+ /**
13718
+ * Total optimizer steps; otherwise derived from epochs, repeats, declared image count and batch size. Supply an accurate count or explicit steps.
13719
+ */
13720
+ steps?: null | number;
13721
+ /**
13722
+ * Starts a new schedule from these LoRA weights. Worker handoffs restore full state automatically.
13723
+ */
13724
+ continueFrom?: null | string;
13725
+ /**
13726
+ * Optional FLUX CLIP-L resource override.
13727
+ */
13728
+ clipLModel?: null | string;
13729
+ /**
13730
+ * Optional FLUX or Chroma T5 text encoder resource override.
13731
+ */
13732
+ textEncoderModel?: null | string;
13733
+ /**
13734
+ * Optional VAE resource override.
13735
+ */
13736
+ vaeModel?: null | string;
13737
+ /**
13738
+ * Use FP8 base weights for FLUX or Chroma; defaults to true for these families.
13739
+ */
13740
+ fp8Base?: null | boolean;
13741
+ /**
13742
+ * Transformer blocks swapped to CPU for FLUX or Chroma; defaults to 18.
13743
+ */
13744
+ blocksToSwap?: null | number;
13745
+ /**
13746
+ * Random seed for training and generated samples.
13747
+ */
13748
+ seed: number;
13749
+ /**
13750
+ * What an epoch job records to its live trace stream (`output.epochs[].traceUrl`), which the consumer can tail
13751
+ * while the job runs.
13752
+ */
13753
+ trace: TrainingTraceMode;
13754
+ /**
13755
+ * Training objective override: true trains with v-prediction. Omit to detect checkpoint markers; unmarked checkpoints default to epsilon. Previews use their own checkpoint detection.
13756
+ */
13757
+ vParameterization?: null | boolean;
13758
+ /**
13759
+ * Training schedule override: true trains with zero terminal SNR. Omit to detect the checkpoint ztsnr marker. Previews use their own checkpoint detection.
13760
+ */
13761
+ zeroTerminalSnr?: null | boolean;
13762
+ engine: 'kohya';
13763
+ };
13495
13764
  export type TrainingInputWritable2 = {
13496
13765
  engine: string;
13497
13766
  trainingData: TrainingData;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './generated';
2
- export * from './utils';
3
- export * from './client/CivitaiClient';
1
+ export * from './generated/index.js';
2
+ export * from './utils/index.js';
3
+ export * from './client/CivitaiClient.js';
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from './generated';
2
- export * from './utils';
3
- export * from './client/CivitaiClient';
1
+ export * from './generated/index.js';
2
+ export * from './utils/index.js';
3
+ export * from './client/CivitaiClient.js';
@@ -1,2 +1,2 @@
1
- import { ProblemDetails } from 'src/generated';
1
+ import { ProblemDetails } from '../generated/index.js';
2
2
  export declare function handleError(error: string | ProblemDetails): string | undefined;
@@ -1,4 +1,4 @@
1
- export * from './Air';
2
- export * from './TimeSpan';
3
- export * from './patch-json';
4
- export * from './handleError';
1
+ export * from './Air.js';
2
+ export * from './TimeSpan.js';
3
+ export * from './patch-json.js';
4
+ export * from './handleError.js';
@@ -1,4 +1,4 @@
1
- export * from './Air';
2
- export * from './TimeSpan';
3
- export * from './patch-json';
4
- export * from './handleError';
1
+ export * from './Air.js';
2
+ export * from './TimeSpan.js';
3
+ export * from './patch-json.js';
4
+ export * from './handleError.js';
@@ -1,5 +1,5 @@
1
1
  import { applyPatch, createPatch } from 'rfc6902';
2
- import { JsonPatchOperation } from 'src/generated';
2
+ import { JsonPatchOperation } from '../generated/index.js';
3
3
  type IsAny<T> = 0 extends 1 & T ? true : false;
4
4
  type IsEqual<T1, T2> = T1 extends T2
5
5
  ? (<G>() => G extends T1 ? 1 : 2) extends <G>() => G extends T2 ? 1 : 2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/orchestration-client",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Civitai's javascript client for generating ai content",
5
5
  "packageManager": "pnpm@10.34.4",
6
6
  "main": "dist/index.js",