Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions packages/lib-infer-diffusion/addonLogging.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
export interface AddonLogging {
setLogger(callback: (priority: number, message: string) => void): void
releaseLogger(): void
}

declare const addonLogging: AddonLogging
Comment thread
gianni-cor marked this conversation as resolved.
export default addonLogging
export function setLogger(callback: (priority: number, message: string) => void): void
export function releaseLogger(): void
7 changes: 6 additions & 1 deletion packages/lib-infer-diffusion/binding.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
module.exports = require.addon()
const binding = require.addon()
const proc = require('bare-process')
Comment thread
gianni-cor marked this conversation as resolved.
Outdated

if (binding.notifyProcessExit) proc.on('exit', () => binding.notifyProcessExit())

module.exports = binding
34 changes: 28 additions & 6 deletions packages/lib-infer-diffusion/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ export type SamplerMethod =
| 'euler'
| 'heun'
| 'dpm2'
| 'dpm++_2m'
| 'dpm++_2m_v2'
| 'dpm++_2s_a'
| 'dpm++2m'
| 'dpm++2mv2'
| 'dpm++2s_a'
| 'lcm'
| 'ipndm'
| 'ipndm_v'
| 'ddim_trailing'
| 'tcd'
| 'res_multistep'
| 'res_2s'

/** Supported weight quantization types */
export type WeightType =
Expand All @@ -34,10 +40,24 @@ export type WeightType =
| 'q8_0'

/** Supported RNG types */
export type RngType = 'cuda' | 'cpu'
export type RngType = 'cuda' | 'cpu' | 'std_default'

/** Supported sampling schedules */
export type ScheduleType = 'default' | 'discrete' | 'karras' | 'exponential' | 'ays' | 'gits'
export type ScheduleType =
| 'discrete'
| 'karras'
| 'exponential'
| 'ays'
| 'gits'
| 'sgm_uniform'
| 'simple'
| 'lcm'
| 'smoothstep'
| 'kl_optimal'
| 'bong_tangent'

/** Supported noise prediction types */
export type PredictionType = 'auto' | 'eps' | 'v' | 'edm_v' | 'flow' | 'flux_flow' | 'flux2_flow'

export interface SdConfig {
/** Number of CPU threads (-1 = auto) */
Expand All @@ -58,6 +78,8 @@ export interface SdConfig {
vae_tiling?: boolean
/** Enable flash attention for memory efficiency */
flash_attn?: boolean
/** Noise prediction type override (auto-detected from model by default) */
prediction?: PredictionType
/** Logging verbosity: 0=error, 1=warn, 2=info, 3=debug */
verbosity?: NumericLike
[key: string]: string | number | boolean | undefined
Expand All @@ -73,7 +95,7 @@ export interface GenerationParams {
cfg_scale?: number
/** Distilled guidance (FLUX.2) */
guidance?: number
/** Sampler name (e.g. 'euler', 'dpm++_2m') */
/** Sampler name (e.g. 'euler', 'dpm++2m') */
sampling_method?: SamplerMethod
/** Scheduler name */
scheduler?: ScheduleType
Expand Down
Loading