File tree 4 files changed +17
-11
lines changed
4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ class Pipeline {
76
76
negativePrompt: String = " " ,
77
77
scheduler: StableDiffusionScheduler ,
78
78
numInferenceSteps stepCount: Int = 50 ,
79
+ //numInferenceSteps stepCount: Int = 4,
79
80
seed: UInt32 = 0 ,
80
81
numPreviews previewCount: Int = 5 ,
81
82
guidanceScale: Float = 7.5 ,
83
+ //guidanceScale: Float = 0,
82
84
disableSafety: Bool = false
83
85
) throws -> GenerationResult {
84
86
let beginDate = Date ( )
Original file line number Diff line number Diff line change @@ -93,14 +93,16 @@ extension PipelineLoader {
93
93
94
94
var packagesFilename : String { ( filename as NSString ) . deletingPathExtension }
95
95
96
- var compiledURL : URL { downloadedURL. deletingLastPathComponent ( ) . appendingPathComponent ( packagesFilename) }
96
+ //var compiledURL: URL { downloadedURL.deletingLastPathComponent().appendingPathComponent(packagesFilename) }
97
+ var compiledURL : URL { URL ( fileURLWithPath: Bundle . main. resourcePath!) }
97
98
98
99
var downloaded : Bool {
99
100
return FileManager . default. fileExists ( atPath: downloadedURL. path)
100
101
}
101
102
102
103
var ready : Bool {
103
- return FileManager . default. fileExists ( atPath: compiledURL. path)
104
+ //return FileManager.default.fileExists(atPath: compiledURL.path)
105
+ true
104
106
}
105
107
106
108
var variant : AttentionVariant {
@@ -165,6 +167,11 @@ extension PipelineLoader {
165
167
let beginDate = Date ( )
166
168
let configuration = MLModelConfiguration ( )
167
169
configuration. computeUnits = computeUnits
170
+
171
+ print ( configuration. computeUnits. rawValue)
172
+ print ( model. reduceMemory)
173
+ print ( compiledURL)
174
+
168
175
let pipeline : StableDiffusionPipelineProtocol
169
176
if model. isXL {
170
177
if #available( macOS 14 . 0 , iOS 17 . 0 , * ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import StableDiffusion
12
12
import CoreML
13
13
14
14
let DEFAULT_MODEL = ModelInfo . sd3
15
- let DEFAULT_PROMPT = " Labrador in the style of Vermeer "
15
+ let DEFAULT_PROMPT = " a photo of puppy "
16
16
17
17
enum GenerationState {
18
18
case startup
@@ -130,8 +130,10 @@ class Settings {
130
130
Keys . computeUnits. rawValue: - 1 , // Use default
131
131
Keys . prompt. rawValue: DEFAULT_PROMPT,
132
132
Keys . negativePrompt. rawValue: " " ,
133
- Keys . guidanceScale. rawValue: 7.5 ,
134
- Keys . stepCount. rawValue: 25 ,
133
+ //Keys.guidanceScale.rawValue: 7.5,
134
+ Keys . guidanceScale. rawValue: 0 ,
135
+ //Keys.stepCount.rawValue: 25,
136
+ Keys . stepCount. rawValue: 4 ,
135
137
Keys . previewCount. rawValue: 5 ,
136
138
Keys . seed. rawValue: 0
137
139
] )
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
<plist version =" 1.0" >
4
- <dict >
5
- <key >NSPhotoLibraryAddUsageDescription </key >
6
- <string >To be able to save generated images to your Photo Library, you’ll need to allow this. </string >
7
- <key >CFBundleDisplayName </key >
8
- <string >Diffusers </string >
9
- </dict >
4
+ <dict />
10
5
</plist >
You can’t perform that action at this time.
0 commit comments