File tree 2 files changed +12
-1
lines changed
Diffusion/Common/Pipeline
Diffusion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
"location" : " https://github.com/apple/ml-stable-diffusion" ,
16
16
"state" : {
17
17
"branch" : " main" ,
18
- "revision" : " 8cf34376f9faf87fc6fe63159e5fae6cbbb71de6 "
18
+ "revision" : " ce8ee78e28613d8a2e4c8b56932b236cb57e7e20 "
19
19
}
20
20
},
21
21
{
Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ class Pipeline {
43
43
let pipeline : StableDiffusionPipelineProtocol
44
44
let maxSeed : UInt32
45
45
46
+ var isXL : Bool {
47
+ if #available( macOS 14 . 0 , iOS 17 . 0 , * ) {
48
+ return ( pipeline as? StableDiffusionXLPipeline ) != nil
49
+ }
50
+ return false
51
+ }
52
+
46
53
var progress : StableDiffusionProgress ? = nil {
47
54
didSet {
48
55
progressPublisher. value = progress
@@ -81,6 +88,10 @@ class Pipeline {
81
88
config. disableSafety = disableSafety
82
89
config. schedulerType = scheduler. asStableDiffusionScheduler ( )
83
90
config. useDenoisedIntermediates = true
91
+ if isXL {
92
+ config. encoderScaleFactor = 0.13025
93
+ config. decoderScaleFactor = 0.13025
94
+ }
84
95
85
96
// Evenly distribute previews based on inference steps
86
97
let previewIndices = previewIndices ( stepCount, previewCount)
You can’t perform that action at this time.
0 commit comments