guernikacore / schedulers Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
hello @GuiyeC
The apple/ml-stable-diffusion project has added SDXL support to DPMSolverMultistepScheduler some time ago.
apple/ml-stable-diffusion@94814cf
At present, only EulerA is compatible with SDXL in Guernika, and other schedulers have different degrees of image quality problems.
Hope you can fix the problem of DPM Solver++ for SDXL.
Is it possible to convert other schedulers that are not available on this repo, like DDPM 3M for ex?
Recently, I saw the research report of nvidia. https://research.nvidia.com/labs/toronto-ai/AlignYourSteps/
The following is my test code, but the schedulers package lacks variables to judge the model type:
// https://github.com/GuernikaCore/Schedulers/blob/1f517514d679e38bb9915c3a74bf04f75d5b5875/Sources/Schedulers/DPMSolverMultistepScheduler.swift#L96
// sd1.5 [999, 850, 736, 645, 545, 455, 343, 233, 124, 24]
let alignSteps = [999, 845, 730, 587, 443, 310, 193, 116, 53, 13]
timeSteps = DPMSolverMultistepScheduler.logInterpolation(steps: alignSteps, desiredCount: stepCount).map { Double($0) }
// https://github.com/GuernikaCore/Schedulers/blob/1f517514d679e38bb9915c3a74bf04f75d5b5875/Sources/Schedulers/Base/Scheduler.swift#L133
static func logInterpolation(steps: [Int], desiredCount: Int) -> [Int] {
var interpolatedSteps = [Int]()
let logSteps = steps.map { log(Double($0)) }
let stepSize = Double(logSteps.count - 1) / Double(desiredCount - 1)
for i in 0..<desiredCount {
let index = Double(i) * stepSize
let lowerIndex = Int(floor(index))
let upperIndex = Int(ceil(index))
if lowerIndex == upperIndex {
interpolatedSteps.append(steps[lowerIndex])
} else {
let lowerValue = logSteps[lowerIndex]
let upperValue = logSteps[upperIndex]
let fraction = index - Double(lowerIndex)
let interpolatedValue = exp(lowerValue + fraction * (upperValue - lowerValue))
interpolatedSteps.append(Int(interpolatedValue))
}
}
return interpolatedSteps
}
The following is the normal SDXL comparison test (DMP++ 2M optimized-timesteps and DMP++ 2M karras, 6 steps)
@GuiyeC
Is the DPM++ SDE Karras algorithm of this project different from other's DPM++ SDE Karras algorithms such as ComfyUI?
DPM++ 2m Karras also has problem.
For the turbo model, DPM++ SDE Karras seems to work normally, but in comparison, it requires 2-3 more steps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.