Skip to content

Extract generateNoise into shared RNG-customizable utility - #178

Merged
stikves merged 2 commits into
apple:mainfrom
stikves:sukru/extract-noise
Aug 17, 2026
Merged

Extract generateNoise into shared RNG-customizable utility#178
stikves merged 2 commits into
apple:mainfrom
stikves:sukru/extract-noise

Conversation

@stikves

@stikves stikves commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Move the duplicated private generateNoise(count:seed:) from Flux2Pipeline, SD3Pipeline, and StableDiffusionPipeline into a module-level free function in RNG/NoiseGeneration.swift.

The new function accepts a RandomSourceType parameter (.numPy, .torch, .nvidia) defaulting to .numPy for backwards compatibility, allowing callers to select the appropriate RNG for their model.

stikves and others added 2 commits August 16, 2026 10:44
Move the duplicated private generateNoise(count:seed:) from
Flux2Pipeline, SD3Pipeline, and StableDiffusionPipeline into a
module-level free function in RNG/NoiseGeneration.swift.

The new function accepts a RandomSourceType parameter (.numPy,
.torch, .nvidia) defaulting to .numPy for backwards compatibility,
allowing callers to select the appropriate RNG for their model.
Comment thread swift/Sources/CoreAIDiffusionPipeline/Pipelines/Flux2Pipeline.swift
@stikves stikves self-assigned this Aug 17, 2026
@stikves
stikves merged commit 4c29ba3 into apple:main Aug 17, 2026
3 checks passed
@stikves
stikves deleted the sukru/extract-noise branch August 17, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants