Skip to content

Commit b8e542e

Browse files
committedJul 25, 2024
Added support for the ml-stable-diffusion 1.1.1
1 parent d58892e commit b8e542e

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed
 

‎coreml-stable-diffusion-swift-example.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
780F590929FBDDD000CED862 /* coreml-stable-diffusion-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 780F590829FBDDD000CED862 /* coreml-stable-diffusion-swift */; };
1110
789DF2422A0BA5C9003AEAA3 /* img_08.gif in Resources */ = {isa = PBXBuildFile; fileRef = 789DF2412A0BA5C9003AEAA3 /* img_08.gif */; };
1211
789E96BC29CDC71600E7C50A /* coreml_stable_diffusion_swift_exampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789E96BB29CDC71600E7C50A /* coreml_stable_diffusion_swift_exampleApp.swift */; };
1312
789E96BE29CDC71600E7C50A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789E96BD29CDC71600E7C50A /* ContentView.swift */; };
@@ -29,6 +28,7 @@
2928
789E970629CDC7D300E7C50A /* LogEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789E970229CDC7D300E7C50A /* LogEvent.swift */; };
3029
789E970729CDC7D300E7C50A /* LogEvenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789E970429CDC7D300E7C50A /* LogEvenType.swift */; };
3130
789E970929CDC98700E7C50A /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 789E970829CDC98600E7C50A /* README.md */; };
31+
78B42EC72C526C3C005E2367 /* coreml-stable-diffusion-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 78B42EC62C526C3C005E2367 /* coreml-stable-diffusion-swift */; };
3232
78EEEE6929DDBB2B00EDF91F /* img_01.png in Resources */ = {isa = PBXBuildFile; fileRef = 78EEEE6829DDBB2B00EDF91F /* img_01.png */; };
3333
78EEEE6F29DDCAA700EDF91F /* img_03.png in Resources */ = {isa = PBXBuildFile; fileRef = 78EEEE6E29DDCAA700EDF91F /* img_03.png */; };
3434
/* End PBXBuildFile section */
@@ -85,7 +85,7 @@
8585
isa = PBXFrameworksBuildPhase;
8686
buildActionMask = 2147483647;
8787
files = (
88-
780F590929FBDDD000CED862 /* coreml-stable-diffusion-swift in Frameworks */,
88+
78B42EC72C526C3C005E2367 /* coreml-stable-diffusion-swift in Frameworks */,
8989
);
9090
runOnlyForDeploymentPostprocessing = 0;
9191
};
@@ -268,7 +268,7 @@
268268
);
269269
name = "coreml-stable-diffusion-swift-example";
270270
packageProductDependencies = (
271-
780F590829FBDDD000CED862 /* coreml-stable-diffusion-swift */,
271+
78B42EC62C526C3C005E2367 /* coreml-stable-diffusion-swift */,
272272
);
273273
productName = "coreml-stable-diffusion-swift-example";
274274
productReference = 789E96B829CDC71600E7C50A /* coreml-stable-diffusion-swift-example.app */;
@@ -343,7 +343,7 @@
343343
);
344344
mainGroup = 789E96AF29CDC71600E7C50A;
345345
packageReferences = (
346-
780F590729FBDDD000CED862 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */,
346+
78B42EC52C526C2A005E2367 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */,
347347
);
348348
productRefGroup = 789E96B929CDC71600E7C50A /* Products */;
349349
projectDirPath = "";
@@ -738,9 +738,9 @@
738738
/* End XCConfigurationList section */
739739

740740
/* Begin XCRemoteSwiftPackageReference section */
741-
780F590729FBDDD000CED862 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */ = {
741+
78B42EC52C526C2A005E2367 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */ = {
742742
isa = XCRemoteSwiftPackageReference;
743-
repositoryURL = "https://github.com/The-Igor/coreml-stable-diffusion-swift.git";
743+
repositoryURL = "https://github.com/The-Igor/coreml-stable-diffusion-swift";
744744
requirement = {
745745
branch = main;
746746
kind = branch;
@@ -749,9 +749,9 @@
749749
/* End XCRemoteSwiftPackageReference section */
750750

751751
/* Begin XCSwiftPackageProductDependency section */
752-
780F590829FBDDD000CED862 /* coreml-stable-diffusion-swift */ = {
752+
78B42EC62C526C3C005E2367 /* coreml-stable-diffusion-swift */ = {
753753
isa = XCSwiftPackageProductDependency;
754-
package = 780F590729FBDDD000CED862 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */;
754+
package = 78B42EC52C526C2A005E2367 /* XCRemoteSwiftPackageReference "coreml-stable-diffusion-swift" */;
755755
productName = "coreml-stable-diffusion-swift";
756756
};
757757
/* End XCSwiftPackageProductDependency section */

‎coreml-stable-diffusion-swift-example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"originHash" : "c8423ba47bc4176700c6c60eacd4f8ce2c24110328711b11d89f97ab2a6b0c9e",
2+
"originHash" : "d4c1f7b3336969183131dacb0085bcb55b5a6bb7bcf174bb964f7c111f85850f",
33
"pins" : [
44
{
55
"identity" : "coreml-stable-diffusion-swift",
66
"kind" : "remoteSourceControl",
7-
"location" : "https://github.com/The-Igor/coreml-stable-diffusion-swift.git",
7+
"location" : "https://github.com/The-Igor/coreml-stable-diffusion-swift",
88
"state" : {
99
"branch" : "main",
10-
"revision" : "b93da3b510429fef0c2eb2682217f84f64300708"
10+
"revision" : "bdd14b7f4e5d018412e8122c137f31c96a76faec"
1111
}
1212
},
1313
{
@@ -24,17 +24,17 @@
2424
"kind" : "remoteSourceControl",
2525
"location" : "https://github.com/apple/ml-stable-diffusion.git",
2626
"state" : {
27-
"revision" : "2c4e9de73c9e723de264356f9563706ea9104212",
28-
"version" : "0.3.0"
27+
"revision" : "5a170d29cf38e674b80541d7ce22929c6a11cdde",
28+
"version" : "1.1.1"
2929
}
3030
},
3131
{
3232
"identity" : "swift-argument-parser",
3333
"kind" : "remoteSourceControl",
3434
"location" : "https://github.com/apple/swift-argument-parser.git",
3535
"state" : {
36-
"revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d",
37-
"version" : "1.2.0"
36+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
37+
"version" : "1.5.0"
3838
}
3939
}
4040
],

‎coreml-stable-diffusion-swift-example/protocol/IEventLoger.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension IEventLoger{
4646
/// - Parameter value: Error
4747
func logError(_ value : Error){
4848

49-
if let e = value as? StableDiffusionPipeline.Error, e == .startingImageProvidedWithoutEncoder{
49+
if let e = value as? PipelineError, e == .startingImageProvidedWithoutEncoder{
5050
addToEventLog("The selected model does not support an input image", type: .error)
5151
addToEventLog("Clean up input image and type in only PROMPT", type: .warning)
5252
}else if let e = value as? Encoder.Error, e == .sampleInputShapeNotCorrect {

‎coreml-stable-diffusion-swift-example/viewmodel/ViewModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ final class ViewModel: ObservableObject, IEventLoger{
116116
}
117117

118118
guard let pipeline = try? getDiffusionPipeline(
119-
for: url, disableSafety, reduceMemory, .cpuAndNeuralEngine
119+
for: url, disableSafety, reduceMemory, .cpuAndGPU
120120
)else{
121121
return
122122
}

0 commit comments

Comments
 (0)
Please sign in to comment.