Project Files
src / flatbuffers / tensor-history-node.ts
import * as flatbuffers from 'flatbuffers';
import { Control } from './control.js';
import { LoRA } from './lo-ra.js';
import { SamplerType } from './sampler-type.js';
import { SeedMode } from './seed-mode.js';
import { Reason } from './reason.js';
// Minimal reader for table TensorHistoryNode (tensor_history.fbs)
// root_type TensorHistoryNode;
export class TensorHistoryNode {
bb: flatbuffers.ByteBuffer | null = null;
bb_pos = 0;
__init(i: number, bb: flatbuffers.ByteBuffer): TensorHistoryNode {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsTensorHistoryNode(bb: flatbuffers.ByteBuffer, obj?: TensorHistoryNode): TensorHistoryNode {
return (obj || new TensorHistoryNode()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsTensorHistoryNode(bb: flatbuffers.ByteBuffer, obj?: TensorHistoryNode): TensorHistoryNode {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TensorHistoryNode()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
lineage(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
logicalTime(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
startWidth(): number {
const offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}
startHeight(): number {
const offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}
seed(): number {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}
steps(): number {
const offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}
guidanceScale(): number {
const offset = this.bb!.__offset(this.bb_pos, 16);
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0;
}
strength(): number {
const offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0;
}
model(): string | null
model(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null
model(optionalEncoding?: any): string | Uint8Array | null {
const offset = this.bb!.__offset(this.bb_pos, 20);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}
tensorId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 22);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
maskId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
depthMapId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 48);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
generated(): boolean {
const offset = this.bb!.__offset(this.bb_pos, 50);
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
}
wallClock(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
textEdits(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : -1n;
}
textLineage(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 30);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : -1n;
}
batchSize(): number {
const offset = this.bb!.__offset(this.bb_pos, 32);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 1;
}
sampler(): SamplerType {
const offset = this.bb!.__offset(this.bb_pos, 34);
return offset ? (this.bb!.readUint8(this.bb_pos + offset) as SamplerType) : SamplerType.DPMPP2MKarras;
}
seedMode(): SeedMode {
const offset = this.bb!.__offset(this.bb_pos, 54);
return offset ? (this.bb!.readUint8(this.bb_pos + offset) as SeedMode) : SeedMode.Legacy;
}
controls(index: number, obj?: Control): Control | null {
const offset = this.bb!.__offset(this.bb_pos, 58);
return offset
? (obj || new Control()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)
: null;
}
controlsLength(): number {
const offset = this.bb!.__offset(this.bb_pos, 58);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
scribbleId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 60);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
poseId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 62);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
loras(index: number, obj?: LoRA): LoRA | null {
const offset = this.bb!.__offset(this.bb_pos, 64);
return offset
? (obj || new LoRA()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)
: null;
}
lorasLength(): number {
const offset = this.bb!.__offset(this.bb_pos, 64);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
colorPaletteId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 66);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
customId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 70);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
dataStored(): number {
const offset = this.bb!.__offset(this.bb_pos, 84);
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}
previewId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 86);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : 0n;
}
targetImageHeight(): number {
const offset = this.bb!.__offset(this.bb_pos, 104);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}
targetImageWidth(): number {
const offset = this.bb!.__offset(this.bb_pos, 106);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}
shuffleDataStored(): number {
const offset = this.bb!.__offset(this.bb_pos, 120);
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}
generationTime(): number {
const offset = this.bb!.__offset(this.bb_pos, 218);
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0;
}
textPrompt(): string | null
textPrompt(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null
textPrompt(optionalEncoding?: any): string | Uint8Array | null {
const offset = this.bb!.__offset(this.bb_pos, 200);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}
negativeTextPrompt(): string | null
negativeTextPrompt(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null
negativeTextPrompt(optionalEncoding?: any): string | Uint8Array | null {
const offset = this.bb!.__offset(this.bb_pos, 202);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}
numFrames(): number {
const offset = this.bb!.__offset(this.bb_pos, 130);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 14;
}
clipId(): bigint {
const offset = this.bb!.__offset(this.bb_pos, 204);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : -1n;
}
indexInAClip(): number {
const offset = this.bb!.__offset(this.bb_pos, 206);
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}
reason(): Reason {
const offset = this.bb!.__offset(this.bb_pos, 220);
return offset ? (this.bb!.readInt32(this.bb_pos + offset) as Reason) : Reason.Other;
}
}