├── .gitattributes ├── .gitignore ├── README.md ├── StableDiffusionSwift.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── swiftpm │ └── Package.resolved └── StableDiffusionSwift ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── ContentView.swift ├── ML Models ├── TextEncoder.mlmodelc │ ├── analytics │ │ └── coremldata.bin │ ├── coremldata.bin │ ├── metadata.json │ ├── model.mil │ └── weights │ │ └── weight.bin ├── UnetChunk1.mlmodelc │ ├── analytics │ │ └── coremldata.bin │ ├── coremldata.bin │ ├── metadata.json │ ├── model.mil │ └── weights │ │ └── weight.bin ├── UnetChunk2.mlmodelc │ ├── analytics │ │ └── coremldata.bin │ ├── coremldata.bin │ ├── metadata.json │ ├── model.mil │ └── weights │ │ └── weight.bin ├── VAEDecoder.mlmodelc │ ├── analytics │ │ └── coremldata.bin │ ├── coremldata.bin │ ├── metadata.json │ ├── model.mil │ └── weights │ │ └── weight.bin ├── merges.txt └── vocab.json ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json ├── StableDiffusionManager.swift ├── StableDiffusionSwift.entitlements └── StableDiffusionSwiftApp.swift /.gitattributes: -------------------------------------------------------------------------------- 1 | *.mlmodelc filter=lfs diff=lfs merge=lfs -text 2 | *.bin filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StableDiffusionSwift 2 | A sample project to create AI-generated images using Apple's Stable Diffusion Swift Package and SwiftUI. 3 | 4 | ![iPhone screenshot of image generated with the prompt "A chicken drinking hot chocolate"](https://user-images.githubusercontent.com/36725840/208247351-0a2d9d51-bd05-439e-9f46-ef769b2d1a21.png) 5 | 6 | Well, close enough 7 | 8 | # References 9 | - [Apple's Stable Diffusion Swift Package](https://github.com/apple/ml-stable-diffusion) 10 | - [Stable Diffusion v2](https://huggingface.co/stabilityai/stable-diffusion-2-base) 11 | -------------------------------------------------------------------------------- /StableDiffusionSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3292DF7D294D9C0F0053B295 /* StableDiffusionSwiftApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3292DF7C294D9C0F0053B295 /* StableDiffusionSwiftApp.swift */; }; 11 | 3292DF7F294D9C0F0053B295 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3292DF7E294D9C0F0053B295 /* ContentView.swift */; }; 12 | 3292DF81294D9C100053B295 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3292DF80294D9C100053B295 /* Assets.xcassets */; }; 13 | 3292DF85294D9C100053B295 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3292DF84294D9C100053B295 /* Preview Assets.xcassets */; }; 14 | 3292DF8C294D9C3D0053B295 /* ML Models in Resources */ = {isa = PBXBuildFile; fileRef = 3292DF8B294D9C3D0053B295 /* ML Models */; }; 15 | 3292DF8F294D9C700053B295 /* StableDiffusion in Frameworks */ = {isa = PBXBuildFile; productRef = 3292DF8E294D9C700053B295 /* StableDiffusion */; }; 16 | 3292DF91294D9C800053B295 /* StableDiffusionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3292DF90294D9C800053B295 /* StableDiffusionManager.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 3292DF79294D9C0F0053B295 /* StableDiffusionSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StableDiffusionSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 3292DF7C294D9C0F0053B295 /* StableDiffusionSwiftApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StableDiffusionSwiftApp.swift; sourceTree = ""; }; 22 | 3292DF7E294D9C0F0053B295 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 23 | 3292DF80294D9C100053B295 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 3292DF82294D9C100053B295 /* StableDiffusionSwift.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = StableDiffusionSwift.entitlements; sourceTree = ""; }; 25 | 3292DF84294D9C100053B295 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 26 | 3292DF8B294D9C3D0053B295 /* ML Models */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "ML Models"; sourceTree = ""; }; 27 | 3292DF90294D9C800053B295 /* StableDiffusionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StableDiffusionManager.swift; sourceTree = ""; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | 3292DF76294D9C0F0053B295 /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | 3292DF8F294D9C700053B295 /* StableDiffusion in Frameworks */, 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 3292DF70294D9C0F0053B295 = { 43 | isa = PBXGroup; 44 | children = ( 45 | 3292DF7B294D9C0F0053B295 /* StableDiffusionSwift */, 46 | 3292DF7A294D9C0F0053B295 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 3292DF7A294D9C0F0053B295 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 3292DF79294D9C0F0053B295 /* StableDiffusionSwift.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 3292DF7B294D9C0F0053B295 /* StableDiffusionSwift */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3292DF7C294D9C0F0053B295 /* StableDiffusionSwiftApp.swift */, 62 | 3292DF7E294D9C0F0053B295 /* ContentView.swift */, 63 | 3292DF90294D9C800053B295 /* StableDiffusionManager.swift */, 64 | 3292DF8B294D9C3D0053B295 /* ML Models */, 65 | 3292DF80294D9C100053B295 /* Assets.xcassets */, 66 | 3292DF82294D9C100053B295 /* StableDiffusionSwift.entitlements */, 67 | 3292DF83294D9C100053B295 /* Preview Content */, 68 | ); 69 | path = StableDiffusionSwift; 70 | sourceTree = ""; 71 | }; 72 | 3292DF83294D9C100053B295 /* Preview Content */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 3292DF84294D9C100053B295 /* Preview Assets.xcassets */, 76 | ); 77 | path = "Preview Content"; 78 | sourceTree = ""; 79 | }; 80 | /* End PBXGroup section */ 81 | 82 | /* Begin PBXNativeTarget section */ 83 | 3292DF78294D9C0F0053B295 /* StableDiffusionSwift */ = { 84 | isa = PBXNativeTarget; 85 | buildConfigurationList = 3292DF88294D9C100053B295 /* Build configuration list for PBXNativeTarget "StableDiffusionSwift" */; 86 | buildPhases = ( 87 | 3292DF75294D9C0F0053B295 /* Sources */, 88 | 3292DF76294D9C0F0053B295 /* Frameworks */, 89 | 3292DF77294D9C0F0053B295 /* Resources */, 90 | ); 91 | buildRules = ( 92 | ); 93 | dependencies = ( 94 | ); 95 | name = StableDiffusionSwift; 96 | packageProductDependencies = ( 97 | 3292DF8E294D9C700053B295 /* StableDiffusion */, 98 | ); 99 | productName = StableDiffusionSwift; 100 | productReference = 3292DF79294D9C0F0053B295 /* StableDiffusionSwift.app */; 101 | productType = "com.apple.product-type.application"; 102 | }; 103 | /* End PBXNativeTarget section */ 104 | 105 | /* Begin PBXProject section */ 106 | 3292DF71294D9C0F0053B295 /* Project object */ = { 107 | isa = PBXProject; 108 | attributes = { 109 | BuildIndependentTargetsInParallel = 1; 110 | LastSwiftUpdateCheck = 1420; 111 | LastUpgradeCheck = 1420; 112 | TargetAttributes = { 113 | 3292DF78294D9C0F0053B295 = { 114 | CreatedOnToolsVersion = 14.2; 115 | }; 116 | }; 117 | }; 118 | buildConfigurationList = 3292DF74294D9C0F0053B295 /* Build configuration list for PBXProject "StableDiffusionSwift" */; 119 | compatibilityVersion = "Xcode 14.0"; 120 | developmentRegion = en; 121 | hasScannedForEncodings = 0; 122 | knownRegions = ( 123 | en, 124 | Base, 125 | ); 126 | mainGroup = 3292DF70294D9C0F0053B295; 127 | packageReferences = ( 128 | 3292DF8D294D9C700053B295 /* XCRemoteSwiftPackageReference "ml-stable-diffusion" */, 129 | ); 130 | productRefGroup = 3292DF7A294D9C0F0053B295 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | 3292DF78294D9C0F0053B295 /* StableDiffusionSwift */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | 3292DF77294D9C0F0053B295 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 3292DF8C294D9C3D0053B295 /* ML Models in Resources */, 145 | 3292DF85294D9C100053B295 /* Preview Assets.xcassets in Resources */, 146 | 3292DF81294D9C100053B295 /* Assets.xcassets in Resources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXResourcesBuildPhase section */ 151 | 152 | /* Begin PBXSourcesBuildPhase section */ 153 | 3292DF75294D9C0F0053B295 /* Sources */ = { 154 | isa = PBXSourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 3292DF91294D9C800053B295 /* StableDiffusionManager.swift in Sources */, 158 | 3292DF7F294D9C0F0053B295 /* ContentView.swift in Sources */, 159 | 3292DF7D294D9C0F0053B295 /* StableDiffusionSwiftApp.swift in Sources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXSourcesBuildPhase section */ 164 | 165 | /* Begin XCBuildConfiguration section */ 166 | 3292DF86294D9C100053B295 /* Debug */ = { 167 | isa = XCBuildConfiguration; 168 | buildSettings = { 169 | ALWAYS_SEARCH_USER_PATHS = NO; 170 | CLANG_ANALYZER_NONNULL = YES; 171 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 172 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 173 | CLANG_ENABLE_MODULES = YES; 174 | CLANG_ENABLE_OBJC_ARC = YES; 175 | CLANG_ENABLE_OBJC_WEAK = YES; 176 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 177 | CLANG_WARN_BOOL_CONVERSION = YES; 178 | CLANG_WARN_COMMA = YES; 179 | CLANG_WARN_CONSTANT_CONVERSION = YES; 180 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 181 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 182 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 183 | CLANG_WARN_EMPTY_BODY = YES; 184 | CLANG_WARN_ENUM_CONVERSION = YES; 185 | CLANG_WARN_INFINITE_RECURSION = YES; 186 | CLANG_WARN_INT_CONVERSION = YES; 187 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 189 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 191 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 192 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 193 | CLANG_WARN_STRICT_PROTOTYPES = YES; 194 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 195 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 196 | CLANG_WARN_UNREACHABLE_CODE = YES; 197 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu11; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 217 | MTL_FAST_MATH = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 220 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 221 | }; 222 | name = Debug; 223 | }; 224 | 3292DF87294D9C100053B295 /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_ANALYZER_NONNULL = YES; 229 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_ENABLE_OBJC_WEAK = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INFINITE_RECURSION = YES; 244 | CLANG_WARN_INT_CONVERSION = YES; 245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 247 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 248 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 249 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 250 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 251 | CLANG_WARN_STRICT_PROTOTYPES = YES; 252 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 253 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 254 | CLANG_WARN_UNREACHABLE_CODE = YES; 255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 256 | COPY_PHASE_STRIP = NO; 257 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 258 | ENABLE_NS_ASSERTIONS = NO; 259 | ENABLE_STRICT_OBJC_MSGSEND = YES; 260 | GCC_C_LANGUAGE_STANDARD = gnu11; 261 | GCC_NO_COMMON_BLOCKS = YES; 262 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 264 | GCC_WARN_UNDECLARED_SELECTOR = YES; 265 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 266 | GCC_WARN_UNUSED_FUNCTION = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | MTL_ENABLE_DEBUG_INFO = NO; 269 | MTL_FAST_MATH = YES; 270 | SWIFT_COMPILATION_MODE = wholemodule; 271 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 272 | }; 273 | name = Release; 274 | }; 275 | 3292DF89294D9C100053B295 /* Debug */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 279 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 280 | CODE_SIGN_ENTITLEMENTS = StableDiffusionSwift/StableDiffusionSwift.entitlements; 281 | CODE_SIGN_STYLE = Automatic; 282 | CURRENT_PROJECT_VERSION = 1; 283 | DEVELOPMENT_ASSET_PATHS = "\"StableDiffusionSwift/Preview Content\""; 284 | DEVELOPMENT_TEAM = XL5JK4F896; 285 | ENABLE_HARDENED_RUNTIME = YES; 286 | ENABLE_PREVIEWS = YES; 287 | GENERATE_INFOPLIST_FILE = YES; 288 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 289 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 290 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 291 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 292 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 293 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 294 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 295 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 296 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 297 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 298 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 299 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 300 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 301 | MACOSX_DEPLOYMENT_TARGET = 13.1; 302 | MARKETING_VERSION = 1.0; 303 | PRODUCT_BUNDLE_IDENTIFIER = app.jiachen.StableDiffusionSwift; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | SDKROOT = auto; 306 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 307 | SWIFT_EMIT_LOC_STRINGS = YES; 308 | SWIFT_VERSION = 5.0; 309 | TARGETED_DEVICE_FAMILY = "1,2"; 310 | }; 311 | name = Debug; 312 | }; 313 | 3292DF8A294D9C100053B295 /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 318 | CODE_SIGN_ENTITLEMENTS = StableDiffusionSwift/StableDiffusionSwift.entitlements; 319 | CODE_SIGN_STYLE = Automatic; 320 | CURRENT_PROJECT_VERSION = 1; 321 | DEVELOPMENT_ASSET_PATHS = "\"StableDiffusionSwift/Preview Content\""; 322 | DEVELOPMENT_TEAM = XL5JK4F896; 323 | ENABLE_HARDENED_RUNTIME = YES; 324 | ENABLE_PREVIEWS = YES; 325 | GENERATE_INFOPLIST_FILE = YES; 326 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; 327 | "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; 328 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; 329 | "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; 330 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; 331 | "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; 332 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; 333 | "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; 334 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 335 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 336 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 337 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; 338 | "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; 339 | MACOSX_DEPLOYMENT_TARGET = 13.1; 340 | MARKETING_VERSION = 1.0; 341 | PRODUCT_BUNDLE_IDENTIFIER = app.jiachen.StableDiffusionSwift; 342 | PRODUCT_NAME = "$(TARGET_NAME)"; 343 | SDKROOT = auto; 344 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; 345 | SWIFT_EMIT_LOC_STRINGS = YES; 346 | SWIFT_VERSION = 5.0; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | }; 349 | name = Release; 350 | }; 351 | /* End XCBuildConfiguration section */ 352 | 353 | /* Begin XCConfigurationList section */ 354 | 3292DF74294D9C0F0053B295 /* Build configuration list for PBXProject "StableDiffusionSwift" */ = { 355 | isa = XCConfigurationList; 356 | buildConfigurations = ( 357 | 3292DF86294D9C100053B295 /* Debug */, 358 | 3292DF87294D9C100053B295 /* Release */, 359 | ); 360 | defaultConfigurationIsVisible = 0; 361 | defaultConfigurationName = Release; 362 | }; 363 | 3292DF88294D9C100053B295 /* Build configuration list for PBXNativeTarget "StableDiffusionSwift" */ = { 364 | isa = XCConfigurationList; 365 | buildConfigurations = ( 366 | 3292DF89294D9C100053B295 /* Debug */, 367 | 3292DF8A294D9C100053B295 /* Release */, 368 | ); 369 | defaultConfigurationIsVisible = 0; 370 | defaultConfigurationName = Release; 371 | }; 372 | /* End XCConfigurationList section */ 373 | 374 | /* Begin XCRemoteSwiftPackageReference section */ 375 | 3292DF8D294D9C700053B295 /* XCRemoteSwiftPackageReference "ml-stable-diffusion" */ = { 376 | isa = XCRemoteSwiftPackageReference; 377 | repositoryURL = "https://github.com/apple/ml-stable-diffusion"; 378 | requirement = { 379 | branch = main; 380 | kind = branch; 381 | }; 382 | }; 383 | /* End XCRemoteSwiftPackageReference section */ 384 | 385 | /* Begin XCSwiftPackageProductDependency section */ 386 | 3292DF8E294D9C700053B295 /* StableDiffusion */ = { 387 | isa = XCSwiftPackageProductDependency; 388 | package = 3292DF8D294D9C700053B295 /* XCRemoteSwiftPackageReference "ml-stable-diffusion" */; 389 | productName = StableDiffusion; 390 | }; 391 | /* End XCSwiftPackageProductDependency section */ 392 | }; 393 | rootObject = 3292DF71294D9C0F0053B295 /* Project object */; 394 | } 395 | -------------------------------------------------------------------------------- /StableDiffusionSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StableDiffusionSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /StableDiffusionSwift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "ml-stable-diffusion", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/apple/ml-stable-diffusion", 7 | "state" : { 8 | "branch" : "main", 9 | "revision" : "66dde8da135593eccef7bbb3a329ccf7bb1724d3" 10 | } 11 | }, 12 | { 13 | "identity" : "swift-argument-parser", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/apple/swift-argument-parser.git", 16 | "state" : { 17 | "revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", 18 | "version" : "1.2.0" 19 | } 20 | } 21 | ], 22 | "version" : 2 23 | } 24 | -------------------------------------------------------------------------------- /StableDiffusionSwift/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /StableDiffusionSwift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "1x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "2x", 16 | "size" : "16x16" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "1x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "2x", 26 | "size" : "32x32" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "2x", 36 | "size" : "128x128" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "1x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "1x", 51 | "size" : "512x512" 52 | }, 53 | { 54 | "idiom" : "mac", 55 | "scale" : "2x", 56 | "size" : "512x512" 57 | } 58 | ], 59 | "info" : { 60 | "author" : "xcode", 61 | "version" : 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /StableDiffusionSwift/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // StableDiffusionSwift 4 | // 5 | // Created by Jia Chen Yee on 17/12/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | 12 | @StateObject var manager = StableDiffusionManager() 13 | 14 | @State var text = "" 15 | 16 | var body: some View { 17 | NavigationStack { 18 | Form { 19 | TextField("Prompt", text: $text) 20 | 21 | Button("Generate") { 22 | manager.generateImage(prompt: text) 23 | } 24 | .disabled(!manager.isReady) 25 | 26 | Section("Images") { 27 | ProgressView(value: manager.progress) 28 | 29 | ForEach(manager.images) { image in 30 | Image(image.cgImage, scale: 1, label: Text("")) 31 | .resizable() 32 | .scaledToFit() 33 | } 34 | } 35 | } 36 | .navigationTitle("Generate Images") 37 | } 38 | } 39 | } 40 | 41 | struct ContentView_Previews: PreviewProvider { 42 | static var previews: some View { 43 | ContentView() 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/TextEncoder.mlmodelc/analytics/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4218de1c41754c45ced86c4e37e1eb6c5acaebf1d2dfee7d79148e9d34341000 3 | size 207 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/TextEncoder.mlmodelc/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8dbf9fe006c80521eb111413aa758b0492c71e1a93435a7a34289dacfc98b989 3 | size 834 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/TextEncoder.mlmodelc/metadata.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "shortDescription" : "Stable Diffusion generates images conditioned on text and\/or other images as input through the diffusion process. Please refer to https:\/\/arxiv.org\/abs\/2112.10752 for details.", 4 | "metadataOutputVersion" : "3.0", 5 | "outputSchema" : [ 6 | { 7 | "hasShapeFlexibility" : "0", 8 | "isOptional" : "0", 9 | "dataType" : "Float32", 10 | "formattedType" : "MultiArray (Float32)", 11 | "shortDescription" : "The token embeddings as encoded by the Transformer model", 12 | "shape" : "[]", 13 | "name" : "last_hidden_state", 14 | "type" : "MultiArray" 15 | }, 16 | { 17 | "hasShapeFlexibility" : "0", 18 | "isOptional" : "0", 19 | "dataType" : "Float32", 20 | "formattedType" : "MultiArray (Float32)", 21 | "shortDescription" : "The version of the `last_hidden_state` output after pooling", 22 | "shape" : "[]", 23 | "name" : "pooled_outputs", 24 | "type" : "MultiArray" 25 | } 26 | ], 27 | "version" : "stabilityai\/stable-diffusion-2-base", 28 | "modelParameters" : [ 29 | 30 | ], 31 | "author" : "Please refer to the Model Card available at huggingface.co\/stabilityai\/stable-diffusion-2-base", 32 | "specificationVersion" : 7, 33 | "storagePrecision" : "Float16", 34 | "license" : "OpenRAIL (https:\/\/huggingface.co\/spaces\/CompVis\/stable-diffusion-license)", 35 | "mlProgramOperationTypeHistogram" : { 36 | "Ios16.cast" : 3, 37 | "Ios16.mul" : 23, 38 | "Ios16.layerNorm" : 47, 39 | "Ios16.sub" : 1, 40 | "BandPart" : 1, 41 | "Stack" : 1, 42 | "Transpose" : 115, 43 | "Ios16.linear" : 138, 44 | "Ios16.add" : 70, 45 | "Ios16.matmul" : 46, 46 | "Ios16.gelu" : 23, 47 | "Ios16.softmax" : 23, 48 | "ExpandDims" : 1, 49 | "Ios16.gather" : 1, 50 | "Ios16.gatherNd" : 1, 51 | "Ios16.reshape" : 230, 52 | "Ios16.reduceArgmax" : 1 53 | }, 54 | "computePrecision" : "Mixed (Float16, Float32, Int32)", 55 | "isUpdatable" : "0", 56 | "availability" : { 57 | "macOS" : "13.0", 58 | "tvOS" : "16.0", 59 | "watchOS" : "9.0", 60 | "iOS" : "16.0", 61 | "macCatalyst" : "16.0" 62 | }, 63 | "modelType" : { 64 | "name" : "MLModelType_mlProgram" 65 | }, 66 | "inputSchema" : [ 67 | { 68 | "hasShapeFlexibility" : "0", 69 | "isOptional" : "0", 70 | "dataType" : "Float32", 71 | "formattedType" : "MultiArray (Float32 1 × 77)", 72 | "shortDescription" : "The token ids that represent the input text", 73 | "shape" : "[1, 77]", 74 | "name" : "input_ids", 75 | "type" : "MultiArray" 76 | } 77 | ], 78 | "userDefinedMetadata" : { 79 | "com.github.apple.coremltools.version" : "6.1", 80 | "com.github.apple.coremltools.source" : "torch==1.13.1" 81 | }, 82 | "generatedClassName" : "Stable_Diffusion_version_stabilityai_stable_diffusion_2_base_text_encoder", 83 | "method" : "predict" 84 | } 85 | ] -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/TextEncoder.mlmodelc/weights/weight.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4ed3197a365a5bc869888e279f69570dc1b08c5fa9f09f1e4385ed367c8f1c67 3 | size 680811520 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk1.mlmodelc/analytics/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d17d2bb7d4566cb0afd9913950e662c79afc4659636d79a3d6075ccda16a5784 3 | size 207 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk1.mlmodelc/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d0ece7c2181a7b0befe97a27dad8450185927c9b01b98ba5e0bc3a594bff473e 3 | size 528 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk1.mlmodelc/metadata.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "metadataOutputVersion" : "3.0", 4 | "storagePrecision" : "Float16", 5 | "outputSchema" : [ 6 | { 7 | "hasShapeFlexibility" : "0", 8 | "isOptional" : "0", 9 | "dataType" : "Float32", 10 | "formattedType" : "MultiArray (Float32)", 11 | "shortDescription" : "", 12 | "shape" : "[]", 13 | "name" : "input_117_cast", 14 | "type" : "MultiArray" 15 | }, 16 | { 17 | "hasShapeFlexibility" : "0", 18 | "isOptional" : "0", 19 | "dataType" : "Float32", 20 | "formattedType" : "MultiArray (Float32)", 21 | "shortDescription" : "", 22 | "shape" : "[]", 23 | "name" : "input_7_cast", 24 | "type" : "MultiArray" 25 | }, 26 | { 27 | "hasShapeFlexibility" : "0", 28 | "isOptional" : "0", 29 | "dataType" : "Float32", 30 | "formattedType" : "MultiArray (Float32)", 31 | "shortDescription" : "", 32 | "shape" : "[]", 33 | "name" : "input_15_cast", 34 | "type" : "MultiArray" 35 | }, 36 | { 37 | "hasShapeFlexibility" : "0", 38 | "isOptional" : "0", 39 | "dataType" : "Float32", 40 | "formattedType" : "MultiArray (Float32)", 41 | "shortDescription" : "", 42 | "shape" : "[]", 43 | "name" : "input_35_cast", 44 | "type" : "MultiArray" 45 | }, 46 | { 47 | "hasShapeFlexibility" : "0", 48 | "isOptional" : "0", 49 | "dataType" : "Float32", 50 | "formattedType" : "MultiArray (Float32)", 51 | "shortDescription" : "", 52 | "shape" : "[]", 53 | "name" : "input_143_cast", 54 | "type" : "MultiArray" 55 | }, 56 | { 57 | "hasShapeFlexibility" : "0", 58 | "isOptional" : "0", 59 | "dataType" : "Float32", 60 | "formattedType" : "MultiArray (Float32)", 61 | "shortDescription" : "", 62 | "shape" : "[]", 63 | "name" : "input_169_cast", 64 | "type" : "MultiArray" 65 | }, 66 | { 67 | "hasShapeFlexibility" : "0", 68 | "isOptional" : "0", 69 | "dataType" : "Float32", 70 | "formattedType" : "MultiArray (Float32)", 71 | "shortDescription" : "", 72 | "shape" : "[]", 73 | "name" : "input_61_cast", 74 | "type" : "MultiArray" 75 | }, 76 | { 77 | "hasShapeFlexibility" : "0", 78 | "isOptional" : "0", 79 | "dataType" : "Float32", 80 | "formattedType" : "MultiArray (Float32)", 81 | "shortDescription" : "", 82 | "shape" : "[]", 83 | "name" : "hidden_states_149_cast", 84 | "type" : "MultiArray" 85 | }, 86 | { 87 | "hasShapeFlexibility" : "0", 88 | "isOptional" : "0", 89 | "dataType" : "Float32", 90 | "formattedType" : "MultiArray (Float32)", 91 | "shortDescription" : "", 92 | "shape" : "[]", 93 | "name" : "input_171_cast", 94 | "type" : "MultiArray" 95 | }, 96 | { 97 | "hasShapeFlexibility" : "0", 98 | "isOptional" : "0", 99 | "dataType" : "Float32", 100 | "formattedType" : "MultiArray (Float32)", 101 | "shortDescription" : "", 102 | "shape" : "[]", 103 | "name" : "input_115_cast", 104 | "type" : "MultiArray" 105 | }, 106 | { 107 | "hasShapeFlexibility" : "0", 108 | "isOptional" : "0", 109 | "dataType" : "Float32", 110 | "formattedType" : "MultiArray (Float32)", 111 | "shortDescription" : "", 112 | "shape" : "[]", 113 | "name" : "input_63_cast", 114 | "type" : "MultiArray" 115 | }, 116 | { 117 | "hasShapeFlexibility" : "0", 118 | "isOptional" : "0", 119 | "dataType" : "Float32", 120 | "formattedType" : "MultiArray (Float32)", 121 | "shortDescription" : "", 122 | "shape" : "[]", 123 | "name" : "input_253_cast", 124 | "type" : "MultiArray" 125 | }, 126 | { 127 | "hasShapeFlexibility" : "0", 128 | "isOptional" : "0", 129 | "dataType" : "Float32", 130 | "formattedType" : "MultiArray (Float32)", 131 | "shortDescription" : "", 132 | "shape" : "[]", 133 | "name" : "input_89_cast", 134 | "type" : "MultiArray" 135 | } 136 | ], 137 | "modelParameters" : [ 138 | 139 | ], 140 | "specificationVersion" : 7, 141 | "mlProgramOperationTypeHistogram" : { 142 | "Transpose" : 14, 143 | "Ios16.reduceMean" : 104, 144 | "Ios16.sin" : 1, 145 | "Ios16.softmax" : 180, 146 | "Split" : 7, 147 | "Ios16.add" : 124, 148 | "Concat" : 18, 149 | "Ios16.realDiv" : 31, 150 | "Ios16.square" : 31, 151 | "ExpandDims" : 3, 152 | "Ios16.sub" : 52, 153 | "Ios16.cast" : 13, 154 | "Ios16.conv" : 129, 155 | "Ios16.einsum" : 360, 156 | "Ios16.gelu" : 7, 157 | "Ios16.reshape" : 76, 158 | "Ios16.batchNorm" : 31, 159 | "Ios16.rsqrt" : 21, 160 | "Ios16.silu" : 26, 161 | "Ios16.sqrt" : 31, 162 | "SliceByIndex" : 542, 163 | "Ios16.mul" : 251, 164 | "Ios16.cos" : 1 165 | }, 166 | "computePrecision" : "Mixed (Float32, Float16, Int32)", 167 | "isUpdatable" : "0", 168 | "availability" : { 169 | "macOS" : "13.0", 170 | "tvOS" : "16.0", 171 | "watchOS" : "9.0", 172 | "iOS" : "16.0", 173 | "macCatalyst" : "16.0" 174 | }, 175 | "modelType" : { 176 | "name" : "MLModelType_mlProgram" 177 | }, 178 | "userDefinedMetadata" : { 179 | 180 | }, 181 | "inputSchema" : [ 182 | { 183 | "hasShapeFlexibility" : "0", 184 | "isOptional" : "0", 185 | "dataType" : "Float16", 186 | "formattedType" : "MultiArray (Float16 2 × 4 × 64 × 64)", 187 | "shortDescription" : "", 188 | "shape" : "[2, 4, 64, 64]", 189 | "name" : "sample", 190 | "type" : "MultiArray" 191 | }, 192 | { 193 | "hasShapeFlexibility" : "0", 194 | "isOptional" : "0", 195 | "dataType" : "Float16", 196 | "formattedType" : "MultiArray (Float16 2)", 197 | "shortDescription" : "", 198 | "shape" : "[2]", 199 | "name" : "timestep", 200 | "type" : "MultiArray" 201 | }, 202 | { 203 | "hasShapeFlexibility" : "0", 204 | "isOptional" : "0", 205 | "dataType" : "Float16", 206 | "formattedType" : "MultiArray (Float16 2 × 1024 × 1 × 77)", 207 | "shortDescription" : "", 208 | "shape" : "[2, 1024, 1, 77]", 209 | "name" : "encoder_hidden_states", 210 | "type" : "MultiArray" 211 | } 212 | ], 213 | "generatedClassName" : "Stable_Diffusion_version_stabilityai_stable_diffusion_2_base_unet_chunk1", 214 | "method" : "predict" 215 | } 216 | ] -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk1.mlmodelc/weights/weight.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:56a56753f43b690cb23e7e8ec008c4e5ce7fb52c781e8cb7d516b94e5bacab97 3 | size 893578816 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk2.mlmodelc/analytics/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca9c12fbe39493fd3cf1241c53612958bf40d9a1882a99c2132c2a4652dd9682 3 | size 207 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk2.mlmodelc/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:184649da1fcacd70bebc5f172cd932f768a20f0287822c44d8014c6afa2f5676 3 | size 594 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk2.mlmodelc/metadata.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "metadataOutputVersion" : "3.0", 4 | "storagePrecision" : "Float16", 5 | "outputSchema" : [ 6 | { 7 | "hasShapeFlexibility" : "0", 8 | "isOptional" : "0", 9 | "dataType" : "Float32", 10 | "formattedType" : "MultiArray (Float32)", 11 | "shortDescription" : "", 12 | "shape" : "[]", 13 | "name" : "noise_pred", 14 | "type" : "MultiArray" 15 | } 16 | ], 17 | "modelParameters" : [ 18 | 19 | ], 20 | "specificationVersion" : 7, 21 | "mlProgramOperationTypeHistogram" : { 22 | "Transpose" : 18, 23 | "UpsampleNearestNeighbor" : 3, 24 | "Ios16.reduceMean" : 114, 25 | "Ios16.softmax" : 210, 26 | "Split" : 9, 27 | "Ios16.add" : 141, 28 | "Concat" : 28, 29 | "Ios16.realDiv" : 30, 30 | "Ios16.square" : 30, 31 | "Ios16.sub" : 57, 32 | "Ios16.cast" : 14, 33 | "Ios16.conv" : 153, 34 | "Ios16.einsum" : 420, 35 | "Ios16.gelu" : 9, 36 | "Ios16.reshape" : 78, 37 | "Ios16.batchNorm" : 30, 38 | "Ios16.rsqrt" : 27, 39 | "Ios16.silu" : 21, 40 | "Ios16.sqrt" : 30, 41 | "SliceByIndex" : 630, 42 | "Ios16.mul" : 300 43 | }, 44 | "computePrecision" : "Mixed (Int32, Float16, Float32)", 45 | "isUpdatable" : "0", 46 | "availability" : { 47 | "macOS" : "13.0", 48 | "tvOS" : "16.0", 49 | "watchOS" : "9.0", 50 | "iOS" : "16.0", 51 | "macCatalyst" : "16.0" 52 | }, 53 | "modelType" : { 54 | "name" : "MLModelType_mlProgram" 55 | }, 56 | "userDefinedMetadata" : { 57 | 58 | }, 59 | "inputSchema" : [ 60 | { 61 | "hasShapeFlexibility" : "0", 62 | "isOptional" : "0", 63 | "dataType" : "Float16", 64 | "formattedType" : "MultiArray (Float16 2 × 1024 × 1 × 77)", 65 | "shortDescription" : "", 66 | "shape" : "[2, 1024, 1, 77]", 67 | "name" : "encoder_hidden_states", 68 | "type" : "MultiArray" 69 | }, 70 | { 71 | "hasShapeFlexibility" : "0", 72 | "isOptional" : "0", 73 | "dataType" : "Float32", 74 | "formattedType" : "MultiArray (Float32 2 × 640 × 32 × 32)", 75 | "shortDescription" : "", 76 | "shape" : "[2, 640, 32, 32]", 77 | "name" : "input_115_cast", 78 | "type" : "MultiArray" 79 | }, 80 | { 81 | "hasShapeFlexibility" : "0", 82 | "isOptional" : "0", 83 | "dataType" : "Float32", 84 | "formattedType" : "MultiArray (Float32 2 × 1280 × 8 × 8)", 85 | "shortDescription" : "", 86 | "shape" : "[2, 1280, 8, 8]", 87 | "name" : "input_171_cast", 88 | "type" : "MultiArray" 89 | }, 90 | { 91 | "hasShapeFlexibility" : "0", 92 | "isOptional" : "0", 93 | "dataType" : "Float32", 94 | "formattedType" : "MultiArray (Float32 2 × 2560 × 8 × 8)", 95 | "shortDescription" : "", 96 | "shape" : "[2, 2560, 8, 8]", 97 | "name" : "input_253_cast", 98 | "type" : "MultiArray" 99 | }, 100 | { 101 | "hasShapeFlexibility" : "0", 102 | "isOptional" : "0", 103 | "dataType" : "Float32", 104 | "formattedType" : "MultiArray (Float32 2 × 320 × 64 × 64)", 105 | "shortDescription" : "", 106 | "shape" : "[2, 320, 64, 64]", 107 | "name" : "input_35_cast", 108 | "type" : "MultiArray" 109 | }, 110 | { 111 | "hasShapeFlexibility" : "0", 112 | "isOptional" : "0", 113 | "dataType" : "Float32", 114 | "formattedType" : "MultiArray (Float32 2 × 640 × 16 × 16)", 115 | "shortDescription" : "", 116 | "shape" : "[2, 640, 16, 16]", 117 | "name" : "input_117_cast", 118 | "type" : "MultiArray" 119 | }, 120 | { 121 | "hasShapeFlexibility" : "0", 122 | "isOptional" : "0", 123 | "dataType" : "Float32", 124 | "formattedType" : "MultiArray (Float32 2 × 320 × 32 × 32)", 125 | "shortDescription" : "", 126 | "shape" : "[2, 320, 32, 32]", 127 | "name" : "input_63_cast", 128 | "type" : "MultiArray" 129 | }, 130 | { 131 | "hasShapeFlexibility" : "0", 132 | "isOptional" : "0", 133 | "dataType" : "Float32", 134 | "formattedType" : "MultiArray (Float32 2 × 1280 × 1 × 1)", 135 | "shortDescription" : "", 136 | "shape" : "[2, 1280, 1, 1]", 137 | "name" : "input_15_cast", 138 | "type" : "MultiArray" 139 | }, 140 | { 141 | "hasShapeFlexibility" : "0", 142 | "isOptional" : "0", 143 | "dataType" : "Float32", 144 | "formattedType" : "MultiArray (Float32 2 × 640 × 32 × 32)", 145 | "shortDescription" : "", 146 | "shape" : "[2, 640, 32, 32]", 147 | "name" : "input_89_cast", 148 | "type" : "MultiArray" 149 | }, 150 | { 151 | "hasShapeFlexibility" : "0", 152 | "isOptional" : "0", 153 | "dataType" : "Float32", 154 | "formattedType" : "MultiArray (Float32 2 × 320 × 64 × 64)", 155 | "shortDescription" : "", 156 | "shape" : "[2, 320, 64, 64]", 157 | "name" : "input_7_cast", 158 | "type" : "MultiArray" 159 | }, 160 | { 161 | "hasShapeFlexibility" : "0", 162 | "isOptional" : "0", 163 | "dataType" : "Float32", 164 | "formattedType" : "MultiArray (Float32 2 × 1280 × 16 × 16)", 165 | "shortDescription" : "", 166 | "shape" : "[2, 1280, 16, 16]", 167 | "name" : "input_143_cast", 168 | "type" : "MultiArray" 169 | }, 170 | { 171 | "hasShapeFlexibility" : "0", 172 | "isOptional" : "0", 173 | "dataType" : "Float32", 174 | "formattedType" : "MultiArray (Float32 2 × 1280 × 16 × 16)", 175 | "shortDescription" : "", 176 | "shape" : "[2, 1280, 16, 16]", 177 | "name" : "input_169_cast", 178 | "type" : "MultiArray" 179 | }, 180 | { 181 | "hasShapeFlexibility" : "0", 182 | "isOptional" : "0", 183 | "dataType" : "Float32", 184 | "formattedType" : "MultiArray (Float32 2 × 1280 × 8 × 8)", 185 | "shortDescription" : "", 186 | "shape" : "[2, 1280, 8, 8]", 187 | "name" : "hidden_states_149_cast", 188 | "type" : "MultiArray" 189 | }, 190 | { 191 | "hasShapeFlexibility" : "0", 192 | "isOptional" : "0", 193 | "dataType" : "Float32", 194 | "formattedType" : "MultiArray (Float32 2 × 320 × 64 × 64)", 195 | "shortDescription" : "", 196 | "shape" : "[2, 320, 64, 64]", 197 | "name" : "input_61_cast", 198 | "type" : "MultiArray" 199 | } 200 | ], 201 | "generatedClassName" : "Stable_Diffusion_version_stabilityai_stable_diffusion_2_base_unet_chunk2", 202 | "method" : "predict" 203 | } 204 | ] -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/UnetChunk2.mlmodelc/weights/weight.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4d7d18b5558bf78f45e3961c198b866c1cd71ed1fc356dc83f0f09d5e720fa9a 3 | size 838545664 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/VAEDecoder.mlmodelc/analytics/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f1f034c35c2b4bc095e95be6c3cf5b58c461224b769b8c536d0ca2aa009a43a 3 | size 207 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/VAEDecoder.mlmodelc/coremldata.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7cd6aac8de55d9168ce62b194b198321462d339e7eb5e12891ed1c122d62e64 3 | size 764 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/VAEDecoder.mlmodelc/metadata.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "shortDescription" : "Stable Diffusion generates images conditioned on text and\/or other images as input through the diffusion process. Please refer to https:\/\/arxiv.org\/abs\/2112.10752 for details.", 4 | "metadataOutputVersion" : "3.0", 5 | "outputSchema" : [ 6 | { 7 | "hasShapeFlexibility" : "0", 8 | "isOptional" : "0", 9 | "dataType" : "Float32", 10 | "formattedType" : "MultiArray (Float32)", 11 | "shortDescription" : "Generated image normalized to range [-1, 1]", 12 | "shape" : "[]", 13 | "name" : "image", 14 | "type" : "MultiArray" 15 | } 16 | ], 17 | "version" : "stabilityai\/stable-diffusion-2-base", 18 | "modelParameters" : [ 19 | 20 | ], 21 | "author" : "Please refer to the Model Card available at huggingface.co\/stabilityai\/stable-diffusion-2-base", 22 | "specificationVersion" : 7, 23 | "storagePrecision" : "Float16", 24 | "license" : "OpenRAIL (https:\/\/huggingface.co\/spaces\/CompVis\/stable-diffusion-license)", 25 | "mlProgramOperationTypeHistogram" : { 26 | "Ios16.cast" : 1, 27 | "Ios16.mul" : 1, 28 | "Ios16.sqrt" : 30, 29 | "Ios16.sub" : 30, 30 | "Transpose" : 7, 31 | "UpsampleNearestNeighbor" : 3, 32 | "Ios16.conv" : 36, 33 | "Ios16.add" : 45, 34 | "Ios16.linear" : 4, 35 | "Ios16.matmul" : 2, 36 | "Ios16.realDiv" : 30, 37 | "Ios16.reduceMean" : 60, 38 | "Ios16.softmax" : 1, 39 | "Ios16.batchNorm" : 30, 40 | "Ios16.square" : 30, 41 | "Ios16.reshape" : 70, 42 | "Ios16.silu" : 29 43 | }, 44 | "computePrecision" : "Mixed (Float32, Float16, Int32)", 45 | "isUpdatable" : "0", 46 | "availability" : { 47 | "macOS" : "13.0", 48 | "tvOS" : "16.0", 49 | "watchOS" : "9.0", 50 | "iOS" : "16.0", 51 | "macCatalyst" : "16.0" 52 | }, 53 | "modelType" : { 54 | "name" : "MLModelType_mlProgram" 55 | }, 56 | "inputSchema" : [ 57 | { 58 | "hasShapeFlexibility" : "0", 59 | "isOptional" : "0", 60 | "dataType" : "Float16", 61 | "formattedType" : "MultiArray (Float16 1 × 4 × 64 × 64)", 62 | "shortDescription" : "The denoised latent embeddings from the unet model after the last step of reverse diffusion", 63 | "shape" : "[1, 4, 64, 64]", 64 | "name" : "z", 65 | "type" : "MultiArray" 66 | } 67 | ], 68 | "userDefinedMetadata" : { 69 | "com.github.apple.coremltools.version" : "6.1", 70 | "com.github.apple.coremltools.source" : "torch==1.13.1" 71 | }, 72 | "generatedClassName" : "Stable_Diffusion_version_stabilityai_stable_diffusion_2_base_vae_decoder", 73 | "method" : "predict" 74 | } 75 | ] -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/VAEDecoder.mlmodelc/model.mil: -------------------------------------------------------------------------------- 1 | program(1.0) 2 | [buildInfo = dict, tensor>({{"coremlc-component-MIL", "4.28.4"}, {"coremlc-version", "1429.0.0"}, {"coremltools-component-torch", "1.13.1"}, {"coremltools-version", "6.1"}})] 3 | { 4 | func main(tensor z) { 5 | tensor var_7 = const()[name = tensor("op_7"), val = tensor(1)]; 6 | tensor var_10 = const()[name = tensor("op_10"), val = tensor([1, 1])]; 7 | tensor var_12 = const()[name = tensor("op_12"), val = tensor([1, 1])]; 8 | tensor input_1_pad_type_0 = const()[name = tensor("input_1_pad_type_0"), val = tensor("custom")]; 9 | tensor input_1_pad_0 = const()[name = tensor("input_1_pad_0"), val = tensor([0, 0, 0, 0])]; 10 | tensor post_quant_conv_weight_to_fp16 = const()[name = tensor("post_quant_conv_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(64)))]; 11 | tensor post_quant_conv_bias_to_fp16 = const()[name = tensor("post_quant_conv_bias_to_fp16"), val = tensor([0x1.06cp-5, -0x1.594p-4, -0x1.f24p-3, 0x1.0d8p-3])]; 12 | tensor input_1_cast = conv(bias = post_quant_conv_bias_to_fp16, dilations = var_12, groups = var_7, pad = input_1_pad_0, pad_type = input_1_pad_type_0, strides = var_10, weight = post_quant_conv_weight_to_fp16, x = z); 13 | tensor var_22 = const()[name = tensor("op_22"), val = tensor(-1)]; 14 | tensor var_28 = const()[name = tensor("op_28"), val = tensor(1)]; 15 | tensor var_46 = const()[name = tensor("op_46"), val = tensor([1, 1])]; 16 | tensor var_48 = const()[name = tensor("op_48"), val = tensor([1, 1])]; 17 | tensor input_3_pad_type_0 = const()[name = tensor("input_3_pad_type_0"), val = tensor("custom")]; 18 | tensor input_3_pad_0 = const()[name = tensor("input_3_pad_0"), val = tensor([1, 1, 1, 1])]; 19 | tensor decoder_conv_in_weight_to_fp16 = const()[name = tensor("decoder_conv_in_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(192)))]; 20 | tensor decoder_conv_in_bias_to_fp16 = const()[name = tensor("decoder_conv_in_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(37120)))]; 21 | tensor input_3_cast = conv(bias = decoder_conv_in_bias_to_fp16, dilations = var_48, groups = var_28, pad = input_3_pad_0, pad_type = input_3_pad_type_0, strides = var_46, weight = decoder_conv_in_weight_to_fp16, x = input_1_cast); 22 | tensor reshape_0_shape_0 = const()[name = tensor("reshape_0_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 23 | tensor reshape_0_cast = reshape(shape = reshape_0_shape_0, x = input_3_cast); 24 | tensor reduce_mean_0_axes_0 = const()[name = tensor("reduce_mean_0_axes_0"), val = tensor([2, 3, 4])]; 25 | tensor reduce_mean_0_keep_dims_0 = const()[name = tensor("reduce_mean_0_keep_dims_0"), val = tensor(true)]; 26 | tensor reduce_mean_0_cast = reduce_mean(axes = reduce_mean_0_axes_0, keep_dims = reduce_mean_0_keep_dims_0, x = reshape_0_cast); 27 | tensor sub_0_cast = sub(x = reshape_0_cast, y = reduce_mean_0_cast); 28 | tensor square_0_cast = square(x = sub_0_cast); 29 | tensor reduce_mean_2_axes_0 = const()[name = tensor("reduce_mean_2_axes_0"), val = tensor([2, 3, 4])]; 30 | tensor reduce_mean_2_keep_dims_0 = const()[name = tensor("reduce_mean_2_keep_dims_0"), val = tensor(true)]; 31 | tensor reduce_mean_2_cast = reduce_mean(axes = reduce_mean_2_axes_0, keep_dims = reduce_mean_2_keep_dims_0, x = square_0_cast); 32 | tensor add_0_y_0_to_fp16 = const()[name = tensor("add_0_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 33 | tensor add_0_cast = add(x = reduce_mean_2_cast, y = add_0_y_0_to_fp16); 34 | tensor sqrt_0_cast = sqrt(x = add_0_cast); 35 | tensor real_div_0_cast = real_div(x = sub_0_cast, y = sqrt_0_cast); 36 | tensor reshape_1_shape_0 = const()[name = tensor("reshape_1_shape_0"), val = tensor([1, 512, 64, 64])]; 37 | tensor reshape_1_cast = reshape(shape = reshape_1_shape_0, x = real_div_0_cast); 38 | tensor add_1_mean_0_to_fp16 = const()[name = tensor("add_1_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(38208)))]; 39 | tensor add_1_variance_0_to_fp16 = const()[name = tensor("add_1_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39296)))]; 40 | tensor add_1_gamma_0_to_fp16 = const()[name = tensor("add_1_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(40384)))]; 41 | tensor add_1_beta_0_to_fp16 = const()[name = tensor("add_1_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(41472)))]; 42 | tensor add_1_epsilon_0_to_fp16 = const()[name = tensor("add_1_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 43 | tensor add_1_cast = batch_norm(beta = add_1_beta_0_to_fp16, epsilon = add_1_epsilon_0_to_fp16, gamma = add_1_gamma_0_to_fp16, mean = add_1_mean_0_to_fp16, variance = add_1_variance_0_to_fp16, x = reshape_1_cast); 44 | tensor input_7_cast = silu(x = add_1_cast); 45 | tensor var_67 = const()[name = tensor("op_67"), val = tensor([1, 1])]; 46 | tensor var_69 = const()[name = tensor("op_69"), val = tensor([1, 1])]; 47 | tensor input_9_pad_type_0 = const()[name = tensor("input_9_pad_type_0"), val = tensor("custom")]; 48 | tensor input_9_pad_0 = const()[name = tensor("input_9_pad_0"), val = tensor([1, 1, 1, 1])]; 49 | tensor decoder_mid_block_resnets_0_conv1_weight_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_0_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(42560)))]; 50 | tensor decoder_mid_block_resnets_0_conv1_bias_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_0_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4761216)))]; 51 | tensor input_9_cast = conv(bias = decoder_mid_block_resnets_0_conv1_bias_to_fp16, dilations = var_69, groups = var_28, pad = input_9_pad_0, pad_type = input_9_pad_type_0, strides = var_67, weight = decoder_mid_block_resnets_0_conv1_weight_to_fp16, x = input_7_cast); 52 | tensor reshape_4_shape_0 = const()[name = tensor("reshape_4_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 53 | tensor reshape_4_cast = reshape(shape = reshape_4_shape_0, x = input_9_cast); 54 | tensor reduce_mean_3_axes_0 = const()[name = tensor("reduce_mean_3_axes_0"), val = tensor([2, 3, 4])]; 55 | tensor reduce_mean_3_keep_dims_0 = const()[name = tensor("reduce_mean_3_keep_dims_0"), val = tensor(true)]; 56 | tensor reduce_mean_3_cast = reduce_mean(axes = reduce_mean_3_axes_0, keep_dims = reduce_mean_3_keep_dims_0, x = reshape_4_cast); 57 | tensor sub_2_cast = sub(x = reshape_4_cast, y = reduce_mean_3_cast); 58 | tensor square_1_cast = square(x = sub_2_cast); 59 | tensor reduce_mean_5_axes_0 = const()[name = tensor("reduce_mean_5_axes_0"), val = tensor([2, 3, 4])]; 60 | tensor reduce_mean_5_keep_dims_0 = const()[name = tensor("reduce_mean_5_keep_dims_0"), val = tensor(true)]; 61 | tensor reduce_mean_5_cast = reduce_mean(axes = reduce_mean_5_axes_0, keep_dims = reduce_mean_5_keep_dims_0, x = square_1_cast); 62 | tensor add_2_y_0_to_fp16 = const()[name = tensor("add_2_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 63 | tensor add_2_cast = add(x = reduce_mean_5_cast, y = add_2_y_0_to_fp16); 64 | tensor sqrt_1_cast = sqrt(x = add_2_cast); 65 | tensor real_div_1_cast = real_div(x = sub_2_cast, y = sqrt_1_cast); 66 | tensor reshape_5_shape_0 = const()[name = tensor("reshape_5_shape_0"), val = tensor([1, 512, 64, 64])]; 67 | tensor reshape_5_cast = reshape(shape = reshape_5_shape_0, x = real_div_1_cast); 68 | tensor add_3_mean_0_to_fp16 = const()[name = tensor("add_3_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4762304)))]; 69 | tensor add_3_variance_0_to_fp16 = const()[name = tensor("add_3_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4763392)))]; 70 | tensor add_3_gamma_0_to_fp16 = const()[name = tensor("add_3_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4764480)))]; 71 | tensor add_3_beta_0_to_fp16 = const()[name = tensor("add_3_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4765568)))]; 72 | tensor add_3_epsilon_0_to_fp16 = const()[name = tensor("add_3_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 73 | tensor add_3_cast = batch_norm(beta = add_3_beta_0_to_fp16, epsilon = add_3_epsilon_0_to_fp16, gamma = add_3_gamma_0_to_fp16, mean = add_3_mean_0_to_fp16, variance = add_3_variance_0_to_fp16, x = reshape_5_cast); 74 | tensor input_13_cast = silu(x = add_3_cast); 75 | tensor var_79 = const()[name = tensor("op_79"), val = tensor([1, 1])]; 76 | tensor var_81 = const()[name = tensor("op_81"), val = tensor([1, 1])]; 77 | tensor hidden_states_1_pad_type_0 = const()[name = tensor("hidden_states_1_pad_type_0"), val = tensor("custom")]; 78 | tensor hidden_states_1_pad_0 = const()[name = tensor("hidden_states_1_pad_0"), val = tensor([1, 1, 1, 1])]; 79 | tensor decoder_mid_block_resnets_0_conv2_weight_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_0_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4766656)))]; 80 | tensor decoder_mid_block_resnets_0_conv2_bias_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_0_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9485312)))]; 81 | tensor hidden_states_1_cast = conv(bias = decoder_mid_block_resnets_0_conv2_bias_to_fp16, dilations = var_81, groups = var_28, pad = hidden_states_1_pad_0, pad_type = hidden_states_1_pad_type_0, strides = var_79, weight = decoder_mid_block_resnets_0_conv2_weight_to_fp16, x = input_13_cast); 82 | tensor var_84_cast = add(x = input_3_cast, y = hidden_states_1_cast); 83 | tensor reshape_8_shape_0 = const()[name = tensor("reshape_8_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 84 | tensor reshape_8_cast = reshape(shape = reshape_8_shape_0, x = var_84_cast); 85 | tensor reduce_mean_6_axes_0 = const()[name = tensor("reduce_mean_6_axes_0"), val = tensor([2, 3, 4])]; 86 | tensor reduce_mean_6_keep_dims_0 = const()[name = tensor("reduce_mean_6_keep_dims_0"), val = tensor(true)]; 87 | tensor reduce_mean_6_cast = reduce_mean(axes = reduce_mean_6_axes_0, keep_dims = reduce_mean_6_keep_dims_0, x = reshape_8_cast); 88 | tensor sub_4_cast = sub(x = reshape_8_cast, y = reduce_mean_6_cast); 89 | tensor square_2_cast = square(x = sub_4_cast); 90 | tensor reduce_mean_8_axes_0 = const()[name = tensor("reduce_mean_8_axes_0"), val = tensor([2, 3, 4])]; 91 | tensor reduce_mean_8_keep_dims_0 = const()[name = tensor("reduce_mean_8_keep_dims_0"), val = tensor(true)]; 92 | tensor reduce_mean_8_cast = reduce_mean(axes = reduce_mean_8_axes_0, keep_dims = reduce_mean_8_keep_dims_0, x = square_2_cast); 93 | tensor add_4_y_0_to_fp16 = const()[name = tensor("add_4_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 94 | tensor add_4_cast = add(x = reduce_mean_8_cast, y = add_4_y_0_to_fp16); 95 | tensor sqrt_2_cast = sqrt(x = add_4_cast); 96 | tensor real_div_2_cast = real_div(x = sub_4_cast, y = sqrt_2_cast); 97 | tensor reshape_9_shape_0 = const()[name = tensor("reshape_9_shape_0"), val = tensor([1, 512, 64, 64])]; 98 | tensor reshape_9_cast = reshape(shape = reshape_9_shape_0, x = real_div_2_cast); 99 | tensor add_5_mean_0_to_fp16 = const()[name = tensor("add_5_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9486400)))]; 100 | tensor add_5_variance_0_to_fp16 = const()[name = tensor("add_5_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9487488)))]; 101 | tensor add_5_gamma_0_to_fp16 = const()[name = tensor("add_5_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9488576)))]; 102 | tensor add_5_beta_0_to_fp16 = const()[name = tensor("add_5_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9489664)))]; 103 | tensor add_5_epsilon_0_to_fp16 = const()[name = tensor("add_5_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 104 | tensor add_5_cast = batch_norm(beta = add_5_beta_0_to_fp16, epsilon = add_5_epsilon_0_to_fp16, gamma = add_5_gamma_0_to_fp16, mean = add_5_mean_0_to_fp16, variance = add_5_variance_0_to_fp16, x = reshape_9_cast); 105 | tensor var_103 = const()[name = tensor("op_103"), val = tensor([1, 512, 4096])]; 106 | tensor var_104_cast = reshape(shape = var_103, x = add_5_cast); 107 | tensor input_17_perm_0 = const()[name = tensor("input_17_perm_0"), val = tensor([0, 2, 1])]; 108 | tensor decoder_mid_block_attentions_0_query_weight_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_query_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(9490752)))]; 109 | tensor decoder_mid_block_attentions_0_query_bias_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_query_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(10015104)))]; 110 | tensor transpose_6 = transpose(perm = input_17_perm_0, x = var_104_cast); 111 | tensor tensor_1_cast = linear(bias = decoder_mid_block_attentions_0_query_bias_to_fp16, weight = decoder_mid_block_attentions_0_query_weight_to_fp16, x = transpose_6); 112 | tensor decoder_mid_block_attentions_0_key_weight_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_key_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(10016192)))]; 113 | tensor decoder_mid_block_attentions_0_key_bias_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_key_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(10540544)))]; 114 | tensor tensor_5_cast = linear(bias = decoder_mid_block_attentions_0_key_bias_to_fp16, weight = decoder_mid_block_attentions_0_key_weight_to_fp16, x = transpose_6); 115 | tensor decoder_mid_block_attentions_0_value_weight_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_value_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(10541632)))]; 116 | tensor decoder_mid_block_attentions_0_value_bias_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_value_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11065984)))]; 117 | tensor tensor_9_cast = linear(bias = decoder_mid_block_attentions_0_value_bias_to_fp16, weight = decoder_mid_block_attentions_0_value_weight_to_fp16, x = transpose_6); 118 | tensor var_122 = const()[name = tensor("op_122"), val = tensor([1, 4096, 1, 512])]; 119 | tensor tensor_3_cast = reshape(shape = var_122, x = tensor_1_cast); 120 | tensor var_124 = const()[name = tensor("op_124"), val = tensor([0, 2, 1, 3])]; 121 | tensor var_131 = const()[name = tensor("op_131"), val = tensor([1, 4096, 512])]; 122 | tensor transpose_5 = transpose(perm = var_124, x = tensor_3_cast); 123 | tensor query_proj_cast = reshape(shape = var_131, x = transpose_5); 124 | tensor var_140 = const()[name = tensor("op_140"), val = tensor([1, 4096, 1, 512])]; 125 | tensor tensor_7_cast = reshape(shape = var_140, x = tensor_5_cast); 126 | tensor var_142 = const()[name = tensor("op_142"), val = tensor([0, 2, 1, 3])]; 127 | tensor var_149 = const()[name = tensor("op_149"), val = tensor([1, 4096, 512])]; 128 | tensor transpose_4 = transpose(perm = var_142, x = tensor_7_cast); 129 | tensor key_proj_cast = reshape(shape = var_149, x = transpose_4); 130 | tensor var_158 = const()[name = tensor("op_158"), val = tensor([1, 4096, 1, 512])]; 131 | tensor tensor_11_cast = reshape(shape = var_158, x = tensor_9_cast); 132 | tensor var_160 = const()[name = tensor("op_160"), val = tensor([0, 2, 1, 3])]; 133 | tensor var_167 = const()[name = tensor("op_167"), val = tensor([1, 4096, 512])]; 134 | tensor transpose_3 = transpose(perm = var_160, x = tensor_11_cast); 135 | tensor value_proj_cast = reshape(shape = var_167, x = transpose_3); 136 | tensor var_174_perm_0 = const()[name = tensor("op_174_perm_0"), val = tensor([0, -1, -2])]; 137 | tensor var_20_to_fp16 = const()[name = tensor("op_20_to_fp16"), val = tensor(0x1.6ap-5)]; 138 | tensor query_proj_scaled_cast = mul(x = var_20_to_fp16, y = query_proj_cast); 139 | tensor attention_scores_1_bmm_transpose_x_0 = const()[name = tensor("attention_scores_1_bmm_transpose_x_0"), val = tensor(false)]; 140 | tensor attention_scores_1_bmm_transpose_y_0 = const()[name = tensor("attention_scores_1_bmm_transpose_y_0"), val = tensor(false)]; 141 | tensor transpose_2 = transpose(perm = var_174_perm_0, x = key_proj_cast); 142 | tensor attention_scores_1_bmm_cast = matmul(transpose_x = attention_scores_1_bmm_transpose_x_0, transpose_y = attention_scores_1_bmm_transpose_y_0, x = query_proj_scaled_cast, y = transpose_2); 143 | tensor var_177_cast = softmax(axis = var_22, x = attention_scores_1_bmm_cast); 144 | tensor tensor_13_transpose_x_0 = const()[name = tensor("tensor_13_transpose_x_0"), val = tensor(false)]; 145 | tensor tensor_13_transpose_y_0 = const()[name = tensor("tensor_13_transpose_y_0"), val = tensor(false)]; 146 | tensor tensor_13_cast = matmul(transpose_x = tensor_13_transpose_x_0, transpose_y = tensor_13_transpose_y_0, x = var_177_cast, y = value_proj_cast); 147 | tensor var_187 = const()[name = tensor("op_187"), val = tensor([1, 1, 4096, 512])]; 148 | tensor tensor_cast = reshape(shape = var_187, x = tensor_13_cast); 149 | tensor var_189 = const()[name = tensor("op_189"), val = tensor([0, 2, 1, 3])]; 150 | tensor var_196 = const()[name = tensor("op_196"), val = tensor([1, 4096, 512])]; 151 | tensor transpose_1 = transpose(perm = var_189, x = tensor_cast); 152 | tensor input_19_cast = reshape(shape = var_196, x = transpose_1); 153 | tensor decoder_mid_block_attentions_0_proj_attn_weight_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_proj_attn_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11067072)))]; 154 | tensor decoder_mid_block_attentions_0_proj_attn_bias_to_fp16 = const()[name = tensor("decoder_mid_block_attentions_0_proj_attn_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11591424)))]; 155 | tensor hidden_states_7_cast = linear(bias = decoder_mid_block_attentions_0_proj_attn_bias_to_fp16, weight = decoder_mid_block_attentions_0_proj_attn_weight_to_fp16, x = input_19_cast); 156 | tensor var_201_perm_0 = const()[name = tensor("op_201_perm_0"), val = tensor([0, -1, -2])]; 157 | tensor var_202 = const()[name = tensor("op_202"), val = tensor([1, 512, 64, 64])]; 158 | tensor transpose_0 = transpose(perm = var_201_perm_0, x = hidden_states_7_cast); 159 | tensor hidden_states_9_cast = reshape(shape = var_202, x = transpose_0); 160 | tensor var_204_cast = add(x = hidden_states_9_cast, y = var_84_cast); 161 | tensor reshape_12_shape_0 = const()[name = tensor("reshape_12_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 162 | tensor reshape_12_cast = reshape(shape = reshape_12_shape_0, x = var_204_cast); 163 | tensor reduce_mean_9_axes_0 = const()[name = tensor("reduce_mean_9_axes_0"), val = tensor([2, 3, 4])]; 164 | tensor reduce_mean_9_keep_dims_0 = const()[name = tensor("reduce_mean_9_keep_dims_0"), val = tensor(true)]; 165 | tensor reduce_mean_9_cast = reduce_mean(axes = reduce_mean_9_axes_0, keep_dims = reduce_mean_9_keep_dims_0, x = reshape_12_cast); 166 | tensor sub_6_cast = sub(x = reshape_12_cast, y = reduce_mean_9_cast); 167 | tensor square_3_cast = square(x = sub_6_cast); 168 | tensor reduce_mean_11_axes_0 = const()[name = tensor("reduce_mean_11_axes_0"), val = tensor([2, 3, 4])]; 169 | tensor reduce_mean_11_keep_dims_0 = const()[name = tensor("reduce_mean_11_keep_dims_0"), val = tensor(true)]; 170 | tensor reduce_mean_11_cast = reduce_mean(axes = reduce_mean_11_axes_0, keep_dims = reduce_mean_11_keep_dims_0, x = square_3_cast); 171 | tensor add_6_y_0_to_fp16 = const()[name = tensor("add_6_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 172 | tensor add_6_cast = add(x = reduce_mean_11_cast, y = add_6_y_0_to_fp16); 173 | tensor sqrt_3_cast = sqrt(x = add_6_cast); 174 | tensor real_div_3_cast = real_div(x = sub_6_cast, y = sqrt_3_cast); 175 | tensor reshape_13_shape_0 = const()[name = tensor("reshape_13_shape_0"), val = tensor([1, 512, 64, 64])]; 176 | tensor reshape_13_cast = reshape(shape = reshape_13_shape_0, x = real_div_3_cast); 177 | tensor add_7_mean_0_to_fp16 = const()[name = tensor("add_7_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11592512)))]; 178 | tensor add_7_variance_0_to_fp16 = const()[name = tensor("add_7_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11593600)))]; 179 | tensor add_7_gamma_0_to_fp16 = const()[name = tensor("add_7_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11594688)))]; 180 | tensor add_7_beta_0_to_fp16 = const()[name = tensor("add_7_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11595776)))]; 181 | tensor add_7_epsilon_0_to_fp16 = const()[name = tensor("add_7_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 182 | tensor add_7_cast = batch_norm(beta = add_7_beta_0_to_fp16, epsilon = add_7_epsilon_0_to_fp16, gamma = add_7_gamma_0_to_fp16, mean = add_7_mean_0_to_fp16, variance = add_7_variance_0_to_fp16, x = reshape_13_cast); 183 | tensor input_25_cast = silu(x = add_7_cast); 184 | tensor var_217 = const()[name = tensor("op_217"), val = tensor([1, 1])]; 185 | tensor var_219 = const()[name = tensor("op_219"), val = tensor([1, 1])]; 186 | tensor input_27_pad_type_0 = const()[name = tensor("input_27_pad_type_0"), val = tensor("custom")]; 187 | tensor input_27_pad_0 = const()[name = tensor("input_27_pad_0"), val = tensor([1, 1, 1, 1])]; 188 | tensor decoder_mid_block_resnets_1_conv1_weight_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_1_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11596864)))]; 189 | tensor decoder_mid_block_resnets_1_conv1_bias_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_1_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16315520)))]; 190 | tensor input_27_cast = conv(bias = decoder_mid_block_resnets_1_conv1_bias_to_fp16, dilations = var_219, groups = var_28, pad = input_27_pad_0, pad_type = input_27_pad_type_0, strides = var_217, weight = decoder_mid_block_resnets_1_conv1_weight_to_fp16, x = input_25_cast); 191 | tensor reshape_16_shape_0 = const()[name = tensor("reshape_16_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 192 | tensor reshape_16_cast = reshape(shape = reshape_16_shape_0, x = input_27_cast); 193 | tensor reduce_mean_12_axes_0 = const()[name = tensor("reduce_mean_12_axes_0"), val = tensor([2, 3, 4])]; 194 | tensor reduce_mean_12_keep_dims_0 = const()[name = tensor("reduce_mean_12_keep_dims_0"), val = tensor(true)]; 195 | tensor reduce_mean_12_cast = reduce_mean(axes = reduce_mean_12_axes_0, keep_dims = reduce_mean_12_keep_dims_0, x = reshape_16_cast); 196 | tensor sub_8_cast = sub(x = reshape_16_cast, y = reduce_mean_12_cast); 197 | tensor square_4_cast = square(x = sub_8_cast); 198 | tensor reduce_mean_14_axes_0 = const()[name = tensor("reduce_mean_14_axes_0"), val = tensor([2, 3, 4])]; 199 | tensor reduce_mean_14_keep_dims_0 = const()[name = tensor("reduce_mean_14_keep_dims_0"), val = tensor(true)]; 200 | tensor reduce_mean_14_cast = reduce_mean(axes = reduce_mean_14_axes_0, keep_dims = reduce_mean_14_keep_dims_0, x = square_4_cast); 201 | tensor add_8_y_0_to_fp16 = const()[name = tensor("add_8_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 202 | tensor add_8_cast = add(x = reduce_mean_14_cast, y = add_8_y_0_to_fp16); 203 | tensor sqrt_4_cast = sqrt(x = add_8_cast); 204 | tensor real_div_4_cast = real_div(x = sub_8_cast, y = sqrt_4_cast); 205 | tensor reshape_17_shape_0 = const()[name = tensor("reshape_17_shape_0"), val = tensor([1, 512, 64, 64])]; 206 | tensor reshape_17_cast = reshape(shape = reshape_17_shape_0, x = real_div_4_cast); 207 | tensor add_9_mean_0_to_fp16 = const()[name = tensor("add_9_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16316608)))]; 208 | tensor add_9_variance_0_to_fp16 = const()[name = tensor("add_9_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16317696)))]; 209 | tensor add_9_gamma_0_to_fp16 = const()[name = tensor("add_9_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16318784)))]; 210 | tensor add_9_beta_0_to_fp16 = const()[name = tensor("add_9_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16319872)))]; 211 | tensor add_9_epsilon_0_to_fp16 = const()[name = tensor("add_9_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 212 | tensor add_9_cast = batch_norm(beta = add_9_beta_0_to_fp16, epsilon = add_9_epsilon_0_to_fp16, gamma = add_9_gamma_0_to_fp16, mean = add_9_mean_0_to_fp16, variance = add_9_variance_0_to_fp16, x = reshape_17_cast); 213 | tensor input_31_cast = silu(x = add_9_cast); 214 | tensor var_229 = const()[name = tensor("op_229"), val = tensor([1, 1])]; 215 | tensor var_231 = const()[name = tensor("op_231"), val = tensor([1, 1])]; 216 | tensor hidden_states_11_pad_type_0 = const()[name = tensor("hidden_states_11_pad_type_0"), val = tensor("custom")]; 217 | tensor hidden_states_11_pad_0 = const()[name = tensor("hidden_states_11_pad_0"), val = tensor([1, 1, 1, 1])]; 218 | tensor decoder_mid_block_resnets_1_conv2_weight_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_1_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16320960)))]; 219 | tensor decoder_mid_block_resnets_1_conv2_bias_to_fp16 = const()[name = tensor("decoder_mid_block_resnets_1_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21039616)))]; 220 | tensor hidden_states_11_cast = conv(bias = decoder_mid_block_resnets_1_conv2_bias_to_fp16, dilations = var_231, groups = var_28, pad = hidden_states_11_pad_0, pad_type = hidden_states_11_pad_type_0, strides = var_229, weight = decoder_mid_block_resnets_1_conv2_weight_to_fp16, x = input_31_cast); 221 | tensor var_234_cast = add(x = var_204_cast, y = hidden_states_11_cast); 222 | tensor reshape_20_shape_0 = const()[name = tensor("reshape_20_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 223 | tensor reshape_20_cast = reshape(shape = reshape_20_shape_0, x = var_234_cast); 224 | tensor reduce_mean_15_axes_0 = const()[name = tensor("reduce_mean_15_axes_0"), val = tensor([2, 3, 4])]; 225 | tensor reduce_mean_15_keep_dims_0 = const()[name = tensor("reduce_mean_15_keep_dims_0"), val = tensor(true)]; 226 | tensor reduce_mean_15_cast = reduce_mean(axes = reduce_mean_15_axes_0, keep_dims = reduce_mean_15_keep_dims_0, x = reshape_20_cast); 227 | tensor sub_10_cast = sub(x = reshape_20_cast, y = reduce_mean_15_cast); 228 | tensor square_5_cast = square(x = sub_10_cast); 229 | tensor reduce_mean_17_axes_0 = const()[name = tensor("reduce_mean_17_axes_0"), val = tensor([2, 3, 4])]; 230 | tensor reduce_mean_17_keep_dims_0 = const()[name = tensor("reduce_mean_17_keep_dims_0"), val = tensor(true)]; 231 | tensor reduce_mean_17_cast = reduce_mean(axes = reduce_mean_17_axes_0, keep_dims = reduce_mean_17_keep_dims_0, x = square_5_cast); 232 | tensor add_10_y_0_to_fp16 = const()[name = tensor("add_10_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 233 | tensor add_10_cast = add(x = reduce_mean_17_cast, y = add_10_y_0_to_fp16); 234 | tensor sqrt_5_cast = sqrt(x = add_10_cast); 235 | tensor real_div_5_cast = real_div(x = sub_10_cast, y = sqrt_5_cast); 236 | tensor reshape_21_shape_0 = const()[name = tensor("reshape_21_shape_0"), val = tensor([1, 512, 64, 64])]; 237 | tensor reshape_21_cast = reshape(shape = reshape_21_shape_0, x = real_div_5_cast); 238 | tensor add_11_mean_0_to_fp16 = const()[name = tensor("add_11_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21040704)))]; 239 | tensor add_11_variance_0_to_fp16 = const()[name = tensor("add_11_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21041792)))]; 240 | tensor add_11_gamma_0_to_fp16 = const()[name = tensor("add_11_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21042880)))]; 241 | tensor add_11_beta_0_to_fp16 = const()[name = tensor("add_11_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21043968)))]; 242 | tensor add_11_epsilon_0_to_fp16 = const()[name = tensor("add_11_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 243 | tensor add_11_cast = batch_norm(beta = add_11_beta_0_to_fp16, epsilon = add_11_epsilon_0_to_fp16, gamma = add_11_gamma_0_to_fp16, mean = add_11_mean_0_to_fp16, variance = add_11_variance_0_to_fp16, x = reshape_21_cast); 244 | tensor input_39_cast = silu(x = add_11_cast); 245 | tensor var_255 = const()[name = tensor("op_255"), val = tensor([1, 1])]; 246 | tensor var_257 = const()[name = tensor("op_257"), val = tensor([1, 1])]; 247 | tensor input_41_pad_type_0 = const()[name = tensor("input_41_pad_type_0"), val = tensor("custom")]; 248 | tensor input_41_pad_0 = const()[name = tensor("input_41_pad_0"), val = tensor([1, 1, 1, 1])]; 249 | tensor decoder_up_blocks_0_resnets_0_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_0_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(21045056)))]; 250 | tensor decoder_up_blocks_0_resnets_0_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_0_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25763712)))]; 251 | tensor input_41_cast = conv(bias = decoder_up_blocks_0_resnets_0_conv1_bias_to_fp16, dilations = var_257, groups = var_28, pad = input_41_pad_0, pad_type = input_41_pad_type_0, strides = var_255, weight = decoder_up_blocks_0_resnets_0_conv1_weight_to_fp16, x = input_39_cast); 252 | tensor reshape_24_shape_0 = const()[name = tensor("reshape_24_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 253 | tensor reshape_24_cast = reshape(shape = reshape_24_shape_0, x = input_41_cast); 254 | tensor reduce_mean_18_axes_0 = const()[name = tensor("reduce_mean_18_axes_0"), val = tensor([2, 3, 4])]; 255 | tensor reduce_mean_18_keep_dims_0 = const()[name = tensor("reduce_mean_18_keep_dims_0"), val = tensor(true)]; 256 | tensor reduce_mean_18_cast = reduce_mean(axes = reduce_mean_18_axes_0, keep_dims = reduce_mean_18_keep_dims_0, x = reshape_24_cast); 257 | tensor sub_12_cast = sub(x = reshape_24_cast, y = reduce_mean_18_cast); 258 | tensor square_6_cast = square(x = sub_12_cast); 259 | tensor reduce_mean_20_axes_0 = const()[name = tensor("reduce_mean_20_axes_0"), val = tensor([2, 3, 4])]; 260 | tensor reduce_mean_20_keep_dims_0 = const()[name = tensor("reduce_mean_20_keep_dims_0"), val = tensor(true)]; 261 | tensor reduce_mean_20_cast = reduce_mean(axes = reduce_mean_20_axes_0, keep_dims = reduce_mean_20_keep_dims_0, x = square_6_cast); 262 | tensor add_12_y_0_to_fp16 = const()[name = tensor("add_12_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 263 | tensor add_12_cast = add(x = reduce_mean_20_cast, y = add_12_y_0_to_fp16); 264 | tensor sqrt_6_cast = sqrt(x = add_12_cast); 265 | tensor real_div_6_cast = real_div(x = sub_12_cast, y = sqrt_6_cast); 266 | tensor reshape_25_shape_0 = const()[name = tensor("reshape_25_shape_0"), val = tensor([1, 512, 64, 64])]; 267 | tensor reshape_25_cast = reshape(shape = reshape_25_shape_0, x = real_div_6_cast); 268 | tensor add_13_mean_0_to_fp16 = const()[name = tensor("add_13_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25764800)))]; 269 | tensor add_13_variance_0_to_fp16 = const()[name = tensor("add_13_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25765888)))]; 270 | tensor add_13_gamma_0_to_fp16 = const()[name = tensor("add_13_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25766976)))]; 271 | tensor add_13_beta_0_to_fp16 = const()[name = tensor("add_13_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25768064)))]; 272 | tensor add_13_epsilon_0_to_fp16 = const()[name = tensor("add_13_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 273 | tensor add_13_cast = batch_norm(beta = add_13_beta_0_to_fp16, epsilon = add_13_epsilon_0_to_fp16, gamma = add_13_gamma_0_to_fp16, mean = add_13_mean_0_to_fp16, variance = add_13_variance_0_to_fp16, x = reshape_25_cast); 274 | tensor input_45_cast = silu(x = add_13_cast); 275 | tensor var_267 = const()[name = tensor("op_267"), val = tensor([1, 1])]; 276 | tensor var_269 = const()[name = tensor("op_269"), val = tensor([1, 1])]; 277 | tensor hidden_states_13_pad_type_0 = const()[name = tensor("hidden_states_13_pad_type_0"), val = tensor("custom")]; 278 | tensor hidden_states_13_pad_0 = const()[name = tensor("hidden_states_13_pad_0"), val = tensor([1, 1, 1, 1])]; 279 | tensor decoder_up_blocks_0_resnets_0_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_0_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(25769152)))]; 280 | tensor decoder_up_blocks_0_resnets_0_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_0_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30487808)))]; 281 | tensor hidden_states_13_cast = conv(bias = decoder_up_blocks_0_resnets_0_conv2_bias_to_fp16, dilations = var_269, groups = var_28, pad = hidden_states_13_pad_0, pad_type = hidden_states_13_pad_type_0, strides = var_267, weight = decoder_up_blocks_0_resnets_0_conv2_weight_to_fp16, x = input_45_cast); 282 | tensor var_272_cast = add(x = var_234_cast, y = hidden_states_13_cast); 283 | tensor reshape_28_shape_0 = const()[name = tensor("reshape_28_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 284 | tensor reshape_28_cast = reshape(shape = reshape_28_shape_0, x = var_272_cast); 285 | tensor reduce_mean_21_axes_0 = const()[name = tensor("reduce_mean_21_axes_0"), val = tensor([2, 3, 4])]; 286 | tensor reduce_mean_21_keep_dims_0 = const()[name = tensor("reduce_mean_21_keep_dims_0"), val = tensor(true)]; 287 | tensor reduce_mean_21_cast = reduce_mean(axes = reduce_mean_21_axes_0, keep_dims = reduce_mean_21_keep_dims_0, x = reshape_28_cast); 288 | tensor sub_14_cast = sub(x = reshape_28_cast, y = reduce_mean_21_cast); 289 | tensor square_7_cast = square(x = sub_14_cast); 290 | tensor reduce_mean_23_axes_0 = const()[name = tensor("reduce_mean_23_axes_0"), val = tensor([2, 3, 4])]; 291 | tensor reduce_mean_23_keep_dims_0 = const()[name = tensor("reduce_mean_23_keep_dims_0"), val = tensor(true)]; 292 | tensor reduce_mean_23_cast = reduce_mean(axes = reduce_mean_23_axes_0, keep_dims = reduce_mean_23_keep_dims_0, x = square_7_cast); 293 | tensor add_14_y_0_to_fp16 = const()[name = tensor("add_14_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 294 | tensor add_14_cast = add(x = reduce_mean_23_cast, y = add_14_y_0_to_fp16); 295 | tensor sqrt_7_cast = sqrt(x = add_14_cast); 296 | tensor real_div_7_cast = real_div(x = sub_14_cast, y = sqrt_7_cast); 297 | tensor reshape_29_shape_0 = const()[name = tensor("reshape_29_shape_0"), val = tensor([1, 512, 64, 64])]; 298 | tensor reshape_29_cast = reshape(shape = reshape_29_shape_0, x = real_div_7_cast); 299 | tensor add_15_mean_0_to_fp16 = const()[name = tensor("add_15_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30488896)))]; 300 | tensor add_15_variance_0_to_fp16 = const()[name = tensor("add_15_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30489984)))]; 301 | tensor add_15_gamma_0_to_fp16 = const()[name = tensor("add_15_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30491072)))]; 302 | tensor add_15_beta_0_to_fp16 = const()[name = tensor("add_15_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30492160)))]; 303 | tensor add_15_epsilon_0_to_fp16 = const()[name = tensor("add_15_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 304 | tensor add_15_cast = batch_norm(beta = add_15_beta_0_to_fp16, epsilon = add_15_epsilon_0_to_fp16, gamma = add_15_gamma_0_to_fp16, mean = add_15_mean_0_to_fp16, variance = add_15_variance_0_to_fp16, x = reshape_29_cast); 305 | tensor input_53_cast = silu(x = add_15_cast); 306 | tensor var_285 = const()[name = tensor("op_285"), val = tensor([1, 1])]; 307 | tensor var_287 = const()[name = tensor("op_287"), val = tensor([1, 1])]; 308 | tensor input_55_pad_type_0 = const()[name = tensor("input_55_pad_type_0"), val = tensor("custom")]; 309 | tensor input_55_pad_0 = const()[name = tensor("input_55_pad_0"), val = tensor([1, 1, 1, 1])]; 310 | tensor decoder_up_blocks_0_resnets_1_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_1_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(30493248)))]; 311 | tensor decoder_up_blocks_0_resnets_1_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_1_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35211904)))]; 312 | tensor input_55_cast = conv(bias = decoder_up_blocks_0_resnets_1_conv1_bias_to_fp16, dilations = var_287, groups = var_28, pad = input_55_pad_0, pad_type = input_55_pad_type_0, strides = var_285, weight = decoder_up_blocks_0_resnets_1_conv1_weight_to_fp16, x = input_53_cast); 313 | tensor reshape_32_shape_0 = const()[name = tensor("reshape_32_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 314 | tensor reshape_32_cast = reshape(shape = reshape_32_shape_0, x = input_55_cast); 315 | tensor reduce_mean_24_axes_0 = const()[name = tensor("reduce_mean_24_axes_0"), val = tensor([2, 3, 4])]; 316 | tensor reduce_mean_24_keep_dims_0 = const()[name = tensor("reduce_mean_24_keep_dims_0"), val = tensor(true)]; 317 | tensor reduce_mean_24_cast = reduce_mean(axes = reduce_mean_24_axes_0, keep_dims = reduce_mean_24_keep_dims_0, x = reshape_32_cast); 318 | tensor sub_16_cast = sub(x = reshape_32_cast, y = reduce_mean_24_cast); 319 | tensor square_8_cast = square(x = sub_16_cast); 320 | tensor reduce_mean_26_axes_0 = const()[name = tensor("reduce_mean_26_axes_0"), val = tensor([2, 3, 4])]; 321 | tensor reduce_mean_26_keep_dims_0 = const()[name = tensor("reduce_mean_26_keep_dims_0"), val = tensor(true)]; 322 | tensor reduce_mean_26_cast = reduce_mean(axes = reduce_mean_26_axes_0, keep_dims = reduce_mean_26_keep_dims_0, x = square_8_cast); 323 | tensor add_16_y_0_to_fp16 = const()[name = tensor("add_16_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 324 | tensor add_16_cast = add(x = reduce_mean_26_cast, y = add_16_y_0_to_fp16); 325 | tensor sqrt_8_cast = sqrt(x = add_16_cast); 326 | tensor real_div_8_cast = real_div(x = sub_16_cast, y = sqrt_8_cast); 327 | tensor reshape_33_shape_0 = const()[name = tensor("reshape_33_shape_0"), val = tensor([1, 512, 64, 64])]; 328 | tensor reshape_33_cast = reshape(shape = reshape_33_shape_0, x = real_div_8_cast); 329 | tensor add_17_mean_0_to_fp16 = const()[name = tensor("add_17_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35212992)))]; 330 | tensor add_17_variance_0_to_fp16 = const()[name = tensor("add_17_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35214080)))]; 331 | tensor add_17_gamma_0_to_fp16 = const()[name = tensor("add_17_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35215168)))]; 332 | tensor add_17_beta_0_to_fp16 = const()[name = tensor("add_17_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35216256)))]; 333 | tensor add_17_epsilon_0_to_fp16 = const()[name = tensor("add_17_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 334 | tensor add_17_cast = batch_norm(beta = add_17_beta_0_to_fp16, epsilon = add_17_epsilon_0_to_fp16, gamma = add_17_gamma_0_to_fp16, mean = add_17_mean_0_to_fp16, variance = add_17_variance_0_to_fp16, x = reshape_33_cast); 335 | tensor input_59_cast = silu(x = add_17_cast); 336 | tensor var_297 = const()[name = tensor("op_297"), val = tensor([1, 1])]; 337 | tensor var_299 = const()[name = tensor("op_299"), val = tensor([1, 1])]; 338 | tensor hidden_states_15_pad_type_0 = const()[name = tensor("hidden_states_15_pad_type_0"), val = tensor("custom")]; 339 | tensor hidden_states_15_pad_0 = const()[name = tensor("hidden_states_15_pad_0"), val = tensor([1, 1, 1, 1])]; 340 | tensor decoder_up_blocks_0_resnets_1_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_1_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(35217344)))]; 341 | tensor decoder_up_blocks_0_resnets_1_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_1_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39936000)))]; 342 | tensor hidden_states_15_cast = conv(bias = decoder_up_blocks_0_resnets_1_conv2_bias_to_fp16, dilations = var_299, groups = var_28, pad = hidden_states_15_pad_0, pad_type = hidden_states_15_pad_type_0, strides = var_297, weight = decoder_up_blocks_0_resnets_1_conv2_weight_to_fp16, x = input_59_cast); 343 | tensor var_302_cast = add(x = var_272_cast, y = hidden_states_15_cast); 344 | tensor reshape_36_shape_0 = const()[name = tensor("reshape_36_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 345 | tensor reshape_36_cast = reshape(shape = reshape_36_shape_0, x = var_302_cast); 346 | tensor reduce_mean_27_axes_0 = const()[name = tensor("reduce_mean_27_axes_0"), val = tensor([2, 3, 4])]; 347 | tensor reduce_mean_27_keep_dims_0 = const()[name = tensor("reduce_mean_27_keep_dims_0"), val = tensor(true)]; 348 | tensor reduce_mean_27_cast = reduce_mean(axes = reduce_mean_27_axes_0, keep_dims = reduce_mean_27_keep_dims_0, x = reshape_36_cast); 349 | tensor sub_18_cast = sub(x = reshape_36_cast, y = reduce_mean_27_cast); 350 | tensor square_9_cast = square(x = sub_18_cast); 351 | tensor reduce_mean_29_axes_0 = const()[name = tensor("reduce_mean_29_axes_0"), val = tensor([2, 3, 4])]; 352 | tensor reduce_mean_29_keep_dims_0 = const()[name = tensor("reduce_mean_29_keep_dims_0"), val = tensor(true)]; 353 | tensor reduce_mean_29_cast = reduce_mean(axes = reduce_mean_29_axes_0, keep_dims = reduce_mean_29_keep_dims_0, x = square_9_cast); 354 | tensor add_18_y_0_to_fp16 = const()[name = tensor("add_18_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 355 | tensor add_18_cast = add(x = reduce_mean_29_cast, y = add_18_y_0_to_fp16); 356 | tensor sqrt_9_cast = sqrt(x = add_18_cast); 357 | tensor real_div_9_cast = real_div(x = sub_18_cast, y = sqrt_9_cast); 358 | tensor reshape_37_shape_0 = const()[name = tensor("reshape_37_shape_0"), val = tensor([1, 512, 64, 64])]; 359 | tensor reshape_37_cast = reshape(shape = reshape_37_shape_0, x = real_div_9_cast); 360 | tensor add_19_mean_0_to_fp16 = const()[name = tensor("add_19_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39937088)))]; 361 | tensor add_19_variance_0_to_fp16 = const()[name = tensor("add_19_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39938176)))]; 362 | tensor add_19_gamma_0_to_fp16 = const()[name = tensor("add_19_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39939264)))]; 363 | tensor add_19_beta_0_to_fp16 = const()[name = tensor("add_19_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39940352)))]; 364 | tensor add_19_epsilon_0_to_fp16 = const()[name = tensor("add_19_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 365 | tensor add_19_cast = batch_norm(beta = add_19_beta_0_to_fp16, epsilon = add_19_epsilon_0_to_fp16, gamma = add_19_gamma_0_to_fp16, mean = add_19_mean_0_to_fp16, variance = add_19_variance_0_to_fp16, x = reshape_37_cast); 366 | tensor input_67_cast = silu(x = add_19_cast); 367 | tensor var_315 = const()[name = tensor("op_315"), val = tensor([1, 1])]; 368 | tensor var_317 = const()[name = tensor("op_317"), val = tensor([1, 1])]; 369 | tensor input_69_pad_type_0 = const()[name = tensor("input_69_pad_type_0"), val = tensor("custom")]; 370 | tensor input_69_pad_0 = const()[name = tensor("input_69_pad_0"), val = tensor([1, 1, 1, 1])]; 371 | tensor decoder_up_blocks_0_resnets_2_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_2_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(39941440)))]; 372 | tensor decoder_up_blocks_0_resnets_2_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_2_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44660096)))]; 373 | tensor input_69_cast = conv(bias = decoder_up_blocks_0_resnets_2_conv1_bias_to_fp16, dilations = var_317, groups = var_28, pad = input_69_pad_0, pad_type = input_69_pad_type_0, strides = var_315, weight = decoder_up_blocks_0_resnets_2_conv1_weight_to_fp16, x = input_67_cast); 374 | tensor reshape_40_shape_0 = const()[name = tensor("reshape_40_shape_0"), val = tensor([1, 32, 16, 64, 64])]; 375 | tensor reshape_40_cast = reshape(shape = reshape_40_shape_0, x = input_69_cast); 376 | tensor reduce_mean_30_axes_0 = const()[name = tensor("reduce_mean_30_axes_0"), val = tensor([2, 3, 4])]; 377 | tensor reduce_mean_30_keep_dims_0 = const()[name = tensor("reduce_mean_30_keep_dims_0"), val = tensor(true)]; 378 | tensor reduce_mean_30_cast = reduce_mean(axes = reduce_mean_30_axes_0, keep_dims = reduce_mean_30_keep_dims_0, x = reshape_40_cast); 379 | tensor sub_20_cast = sub(x = reshape_40_cast, y = reduce_mean_30_cast); 380 | tensor square_10_cast = square(x = sub_20_cast); 381 | tensor reduce_mean_32_axes_0 = const()[name = tensor("reduce_mean_32_axes_0"), val = tensor([2, 3, 4])]; 382 | tensor reduce_mean_32_keep_dims_0 = const()[name = tensor("reduce_mean_32_keep_dims_0"), val = tensor(true)]; 383 | tensor reduce_mean_32_cast = reduce_mean(axes = reduce_mean_32_axes_0, keep_dims = reduce_mean_32_keep_dims_0, x = square_10_cast); 384 | tensor add_20_y_0_to_fp16 = const()[name = tensor("add_20_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 385 | tensor add_20_cast = add(x = reduce_mean_32_cast, y = add_20_y_0_to_fp16); 386 | tensor sqrt_10_cast = sqrt(x = add_20_cast); 387 | tensor real_div_10_cast = real_div(x = sub_20_cast, y = sqrt_10_cast); 388 | tensor reshape_41_shape_0 = const()[name = tensor("reshape_41_shape_0"), val = tensor([1, 512, 64, 64])]; 389 | tensor reshape_41_cast = reshape(shape = reshape_41_shape_0, x = real_div_10_cast); 390 | tensor add_21_mean_0_to_fp16 = const()[name = tensor("add_21_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44661184)))]; 391 | tensor add_21_variance_0_to_fp16 = const()[name = tensor("add_21_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44662272)))]; 392 | tensor add_21_gamma_0_to_fp16 = const()[name = tensor("add_21_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44663360)))]; 393 | tensor add_21_beta_0_to_fp16 = const()[name = tensor("add_21_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44664448)))]; 394 | tensor add_21_epsilon_0_to_fp16 = const()[name = tensor("add_21_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 395 | tensor add_21_cast = batch_norm(beta = add_21_beta_0_to_fp16, epsilon = add_21_epsilon_0_to_fp16, gamma = add_21_gamma_0_to_fp16, mean = add_21_mean_0_to_fp16, variance = add_21_variance_0_to_fp16, x = reshape_41_cast); 396 | tensor input_73_cast = silu(x = add_21_cast); 397 | tensor var_327 = const()[name = tensor("op_327"), val = tensor([1, 1])]; 398 | tensor var_329 = const()[name = tensor("op_329"), val = tensor([1, 1])]; 399 | tensor hidden_states_17_pad_type_0 = const()[name = tensor("hidden_states_17_pad_type_0"), val = tensor("custom")]; 400 | tensor hidden_states_17_pad_0 = const()[name = tensor("hidden_states_17_pad_0"), val = tensor([1, 1, 1, 1])]; 401 | tensor decoder_up_blocks_0_resnets_2_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_2_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(44665536)))]; 402 | tensor decoder_up_blocks_0_resnets_2_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_resnets_2_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(49384192)))]; 403 | tensor hidden_states_17_cast = conv(bias = decoder_up_blocks_0_resnets_2_conv2_bias_to_fp16, dilations = var_329, groups = var_28, pad = hidden_states_17_pad_0, pad_type = hidden_states_17_pad_type_0, strides = var_327, weight = decoder_up_blocks_0_resnets_2_conv2_weight_to_fp16, x = input_73_cast); 404 | tensor var_332_cast = add(x = var_302_cast, y = hidden_states_17_cast); 405 | tensor input_77_scale_factor_height_0 = const()[name = tensor("input_77_scale_factor_height_0"), val = tensor(0x1p+1)]; 406 | tensor input_77_scale_factor_width_0 = const()[name = tensor("input_77_scale_factor_width_0"), val = tensor(0x1p+1)]; 407 | tensor input_77_cast = upsample_nearest_neighbor(scale_factor_height = input_77_scale_factor_height_0, scale_factor_width = input_77_scale_factor_width_0, x = var_332_cast); 408 | tensor var_340 = const()[name = tensor("op_340"), val = tensor([1, 1])]; 409 | tensor var_342 = const()[name = tensor("op_342"), val = tensor([1, 1])]; 410 | tensor input_79_pad_type_0 = const()[name = tensor("input_79_pad_type_0"), val = tensor("custom")]; 411 | tensor input_79_pad_0 = const()[name = tensor("input_79_pad_0"), val = tensor([1, 1, 1, 1])]; 412 | tensor decoder_up_blocks_0_upsamplers_0_conv_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_0_upsamplers_0_conv_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(49385280)))]; 413 | tensor decoder_up_blocks_0_upsamplers_0_conv_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_0_upsamplers_0_conv_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54103936)))]; 414 | tensor input_79_cast = conv(bias = decoder_up_blocks_0_upsamplers_0_conv_bias_to_fp16, dilations = var_342, groups = var_28, pad = input_79_pad_0, pad_type = input_79_pad_type_0, strides = var_340, weight = decoder_up_blocks_0_upsamplers_0_conv_weight_to_fp16, x = input_77_cast); 415 | tensor reshape_44_shape_0 = const()[name = tensor("reshape_44_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 416 | tensor reshape_44_cast = reshape(shape = reshape_44_shape_0, x = input_79_cast); 417 | tensor reduce_mean_33_axes_0 = const()[name = tensor("reduce_mean_33_axes_0"), val = tensor([2, 3, 4])]; 418 | tensor reduce_mean_33_keep_dims_0 = const()[name = tensor("reduce_mean_33_keep_dims_0"), val = tensor(true)]; 419 | tensor reduce_mean_33_cast = reduce_mean(axes = reduce_mean_33_axes_0, keep_dims = reduce_mean_33_keep_dims_0, x = reshape_44_cast); 420 | tensor sub_22_cast = sub(x = reshape_44_cast, y = reduce_mean_33_cast); 421 | tensor square_11_cast = square(x = sub_22_cast); 422 | tensor reduce_mean_35_axes_0 = const()[name = tensor("reduce_mean_35_axes_0"), val = tensor([2, 3, 4])]; 423 | tensor reduce_mean_35_keep_dims_0 = const()[name = tensor("reduce_mean_35_keep_dims_0"), val = tensor(true)]; 424 | tensor reduce_mean_35_cast = reduce_mean(axes = reduce_mean_35_axes_0, keep_dims = reduce_mean_35_keep_dims_0, x = square_11_cast); 425 | tensor add_22_y_0_to_fp16 = const()[name = tensor("add_22_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 426 | tensor add_22_cast = add(x = reduce_mean_35_cast, y = add_22_y_0_to_fp16); 427 | tensor sqrt_11_cast = sqrt(x = add_22_cast); 428 | tensor real_div_11_cast = real_div(x = sub_22_cast, y = sqrt_11_cast); 429 | tensor reshape_45_shape_0 = const()[name = tensor("reshape_45_shape_0"), val = tensor([1, 512, 128, 128])]; 430 | tensor reshape_45_cast = reshape(shape = reshape_45_shape_0, x = real_div_11_cast); 431 | tensor add_23_mean_0_to_fp16 = const()[name = tensor("add_23_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54105024)))]; 432 | tensor add_23_variance_0_to_fp16 = const()[name = tensor("add_23_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54106112)))]; 433 | tensor add_23_gamma_0_to_fp16 = const()[name = tensor("add_23_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54107200)))]; 434 | tensor add_23_beta_0_to_fp16 = const()[name = tensor("add_23_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54108288)))]; 435 | tensor add_23_epsilon_0_to_fp16 = const()[name = tensor("add_23_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 436 | tensor add_23_cast = batch_norm(beta = add_23_beta_0_to_fp16, epsilon = add_23_epsilon_0_to_fp16, gamma = add_23_gamma_0_to_fp16, mean = add_23_mean_0_to_fp16, variance = add_23_variance_0_to_fp16, x = reshape_45_cast); 437 | tensor input_83_cast = silu(x = add_23_cast); 438 | tensor var_363 = const()[name = tensor("op_363"), val = tensor([1, 1])]; 439 | tensor var_365 = const()[name = tensor("op_365"), val = tensor([1, 1])]; 440 | tensor input_85_pad_type_0 = const()[name = tensor("input_85_pad_type_0"), val = tensor("custom")]; 441 | tensor input_85_pad_0 = const()[name = tensor("input_85_pad_0"), val = tensor([1, 1, 1, 1])]; 442 | tensor decoder_up_blocks_1_resnets_0_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_0_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(54109376)))]; 443 | tensor decoder_up_blocks_1_resnets_0_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_0_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58828032)))]; 444 | tensor input_85_cast = conv(bias = decoder_up_blocks_1_resnets_0_conv1_bias_to_fp16, dilations = var_365, groups = var_28, pad = input_85_pad_0, pad_type = input_85_pad_type_0, strides = var_363, weight = decoder_up_blocks_1_resnets_0_conv1_weight_to_fp16, x = input_83_cast); 445 | tensor reshape_48_shape_0 = const()[name = tensor("reshape_48_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 446 | tensor reshape_48_cast = reshape(shape = reshape_48_shape_0, x = input_85_cast); 447 | tensor reduce_mean_36_axes_0 = const()[name = tensor("reduce_mean_36_axes_0"), val = tensor([2, 3, 4])]; 448 | tensor reduce_mean_36_keep_dims_0 = const()[name = tensor("reduce_mean_36_keep_dims_0"), val = tensor(true)]; 449 | tensor reduce_mean_36_cast = reduce_mean(axes = reduce_mean_36_axes_0, keep_dims = reduce_mean_36_keep_dims_0, x = reshape_48_cast); 450 | tensor sub_24_cast = sub(x = reshape_48_cast, y = reduce_mean_36_cast); 451 | tensor square_12_cast = square(x = sub_24_cast); 452 | tensor reduce_mean_38_axes_0 = const()[name = tensor("reduce_mean_38_axes_0"), val = tensor([2, 3, 4])]; 453 | tensor reduce_mean_38_keep_dims_0 = const()[name = tensor("reduce_mean_38_keep_dims_0"), val = tensor(true)]; 454 | tensor reduce_mean_38_cast = reduce_mean(axes = reduce_mean_38_axes_0, keep_dims = reduce_mean_38_keep_dims_0, x = square_12_cast); 455 | tensor add_24_y_0_to_fp16 = const()[name = tensor("add_24_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 456 | tensor add_24_cast = add(x = reduce_mean_38_cast, y = add_24_y_0_to_fp16); 457 | tensor sqrt_12_cast = sqrt(x = add_24_cast); 458 | tensor real_div_12_cast = real_div(x = sub_24_cast, y = sqrt_12_cast); 459 | tensor reshape_49_shape_0 = const()[name = tensor("reshape_49_shape_0"), val = tensor([1, 512, 128, 128])]; 460 | tensor reshape_49_cast = reshape(shape = reshape_49_shape_0, x = real_div_12_cast); 461 | tensor add_25_mean_0_to_fp16 = const()[name = tensor("add_25_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58829120)))]; 462 | tensor add_25_variance_0_to_fp16 = const()[name = tensor("add_25_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58830208)))]; 463 | tensor add_25_gamma_0_to_fp16 = const()[name = tensor("add_25_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58831296)))]; 464 | tensor add_25_beta_0_to_fp16 = const()[name = tensor("add_25_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58832384)))]; 465 | tensor add_25_epsilon_0_to_fp16 = const()[name = tensor("add_25_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 466 | tensor add_25_cast = batch_norm(beta = add_25_beta_0_to_fp16, epsilon = add_25_epsilon_0_to_fp16, gamma = add_25_gamma_0_to_fp16, mean = add_25_mean_0_to_fp16, variance = add_25_variance_0_to_fp16, x = reshape_49_cast); 467 | tensor input_89_cast = silu(x = add_25_cast); 468 | tensor var_375 = const()[name = tensor("op_375"), val = tensor([1, 1])]; 469 | tensor var_377 = const()[name = tensor("op_377"), val = tensor([1, 1])]; 470 | tensor hidden_states_21_pad_type_0 = const()[name = tensor("hidden_states_21_pad_type_0"), val = tensor("custom")]; 471 | tensor hidden_states_21_pad_0 = const()[name = tensor("hidden_states_21_pad_0"), val = tensor([1, 1, 1, 1])]; 472 | tensor decoder_up_blocks_1_resnets_0_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_0_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(58833472)))]; 473 | tensor decoder_up_blocks_1_resnets_0_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_0_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63552128)))]; 474 | tensor hidden_states_21_cast = conv(bias = decoder_up_blocks_1_resnets_0_conv2_bias_to_fp16, dilations = var_377, groups = var_28, pad = hidden_states_21_pad_0, pad_type = hidden_states_21_pad_type_0, strides = var_375, weight = decoder_up_blocks_1_resnets_0_conv2_weight_to_fp16, x = input_89_cast); 475 | tensor var_380_cast = add(x = input_79_cast, y = hidden_states_21_cast); 476 | tensor reshape_52_shape_0 = const()[name = tensor("reshape_52_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 477 | tensor reshape_52_cast = reshape(shape = reshape_52_shape_0, x = var_380_cast); 478 | tensor reduce_mean_39_axes_0 = const()[name = tensor("reduce_mean_39_axes_0"), val = tensor([2, 3, 4])]; 479 | tensor reduce_mean_39_keep_dims_0 = const()[name = tensor("reduce_mean_39_keep_dims_0"), val = tensor(true)]; 480 | tensor reduce_mean_39_cast = reduce_mean(axes = reduce_mean_39_axes_0, keep_dims = reduce_mean_39_keep_dims_0, x = reshape_52_cast); 481 | tensor sub_26_cast = sub(x = reshape_52_cast, y = reduce_mean_39_cast); 482 | tensor square_13_cast = square(x = sub_26_cast); 483 | tensor reduce_mean_41_axes_0 = const()[name = tensor("reduce_mean_41_axes_0"), val = tensor([2, 3, 4])]; 484 | tensor reduce_mean_41_keep_dims_0 = const()[name = tensor("reduce_mean_41_keep_dims_0"), val = tensor(true)]; 485 | tensor reduce_mean_41_cast = reduce_mean(axes = reduce_mean_41_axes_0, keep_dims = reduce_mean_41_keep_dims_0, x = square_13_cast); 486 | tensor add_26_y_0_to_fp16 = const()[name = tensor("add_26_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 487 | tensor add_26_cast = add(x = reduce_mean_41_cast, y = add_26_y_0_to_fp16); 488 | tensor sqrt_13_cast = sqrt(x = add_26_cast); 489 | tensor real_div_13_cast = real_div(x = sub_26_cast, y = sqrt_13_cast); 490 | tensor reshape_53_shape_0 = const()[name = tensor("reshape_53_shape_0"), val = tensor([1, 512, 128, 128])]; 491 | tensor reshape_53_cast = reshape(shape = reshape_53_shape_0, x = real_div_13_cast); 492 | tensor add_27_mean_0_to_fp16 = const()[name = tensor("add_27_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63553216)))]; 493 | tensor add_27_variance_0_to_fp16 = const()[name = tensor("add_27_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63554304)))]; 494 | tensor add_27_gamma_0_to_fp16 = const()[name = tensor("add_27_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63555392)))]; 495 | tensor add_27_beta_0_to_fp16 = const()[name = tensor("add_27_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63556480)))]; 496 | tensor add_27_epsilon_0_to_fp16 = const()[name = tensor("add_27_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 497 | tensor add_27_cast = batch_norm(beta = add_27_beta_0_to_fp16, epsilon = add_27_epsilon_0_to_fp16, gamma = add_27_gamma_0_to_fp16, mean = add_27_mean_0_to_fp16, variance = add_27_variance_0_to_fp16, x = reshape_53_cast); 498 | tensor input_97_cast = silu(x = add_27_cast); 499 | tensor var_393 = const()[name = tensor("op_393"), val = tensor([1, 1])]; 500 | tensor var_395 = const()[name = tensor("op_395"), val = tensor([1, 1])]; 501 | tensor input_99_pad_type_0 = const()[name = tensor("input_99_pad_type_0"), val = tensor("custom")]; 502 | tensor input_99_pad_0 = const()[name = tensor("input_99_pad_0"), val = tensor([1, 1, 1, 1])]; 503 | tensor decoder_up_blocks_1_resnets_1_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_1_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(63557568)))]; 504 | tensor decoder_up_blocks_1_resnets_1_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_1_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68276224)))]; 505 | tensor input_99_cast = conv(bias = decoder_up_blocks_1_resnets_1_conv1_bias_to_fp16, dilations = var_395, groups = var_28, pad = input_99_pad_0, pad_type = input_99_pad_type_0, strides = var_393, weight = decoder_up_blocks_1_resnets_1_conv1_weight_to_fp16, x = input_97_cast); 506 | tensor reshape_56_shape_0 = const()[name = tensor("reshape_56_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 507 | tensor reshape_56_cast = reshape(shape = reshape_56_shape_0, x = input_99_cast); 508 | tensor reduce_mean_42_axes_0 = const()[name = tensor("reduce_mean_42_axes_0"), val = tensor([2, 3, 4])]; 509 | tensor reduce_mean_42_keep_dims_0 = const()[name = tensor("reduce_mean_42_keep_dims_0"), val = tensor(true)]; 510 | tensor reduce_mean_42_cast = reduce_mean(axes = reduce_mean_42_axes_0, keep_dims = reduce_mean_42_keep_dims_0, x = reshape_56_cast); 511 | tensor sub_28_cast = sub(x = reshape_56_cast, y = reduce_mean_42_cast); 512 | tensor square_14_cast = square(x = sub_28_cast); 513 | tensor reduce_mean_44_axes_0 = const()[name = tensor("reduce_mean_44_axes_0"), val = tensor([2, 3, 4])]; 514 | tensor reduce_mean_44_keep_dims_0 = const()[name = tensor("reduce_mean_44_keep_dims_0"), val = tensor(true)]; 515 | tensor reduce_mean_44_cast = reduce_mean(axes = reduce_mean_44_axes_0, keep_dims = reduce_mean_44_keep_dims_0, x = square_14_cast); 516 | tensor add_28_y_0_to_fp16 = const()[name = tensor("add_28_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 517 | tensor add_28_cast = add(x = reduce_mean_44_cast, y = add_28_y_0_to_fp16); 518 | tensor sqrt_14_cast = sqrt(x = add_28_cast); 519 | tensor real_div_14_cast = real_div(x = sub_28_cast, y = sqrt_14_cast); 520 | tensor reshape_57_shape_0 = const()[name = tensor("reshape_57_shape_0"), val = tensor([1, 512, 128, 128])]; 521 | tensor reshape_57_cast = reshape(shape = reshape_57_shape_0, x = real_div_14_cast); 522 | tensor add_29_mean_0_to_fp16 = const()[name = tensor("add_29_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68277312)))]; 523 | tensor add_29_variance_0_to_fp16 = const()[name = tensor("add_29_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68278400)))]; 524 | tensor add_29_gamma_0_to_fp16 = const()[name = tensor("add_29_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68279488)))]; 525 | tensor add_29_beta_0_to_fp16 = const()[name = tensor("add_29_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68280576)))]; 526 | tensor add_29_epsilon_0_to_fp16 = const()[name = tensor("add_29_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 527 | tensor add_29_cast = batch_norm(beta = add_29_beta_0_to_fp16, epsilon = add_29_epsilon_0_to_fp16, gamma = add_29_gamma_0_to_fp16, mean = add_29_mean_0_to_fp16, variance = add_29_variance_0_to_fp16, x = reshape_57_cast); 528 | tensor input_103_cast = silu(x = add_29_cast); 529 | tensor var_405 = const()[name = tensor("op_405"), val = tensor([1, 1])]; 530 | tensor var_407 = const()[name = tensor("op_407"), val = tensor([1, 1])]; 531 | tensor hidden_states_23_pad_type_0 = const()[name = tensor("hidden_states_23_pad_type_0"), val = tensor("custom")]; 532 | tensor hidden_states_23_pad_0 = const()[name = tensor("hidden_states_23_pad_0"), val = tensor([1, 1, 1, 1])]; 533 | tensor decoder_up_blocks_1_resnets_1_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_1_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(68281664)))]; 534 | tensor decoder_up_blocks_1_resnets_1_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_1_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73000320)))]; 535 | tensor hidden_states_23_cast = conv(bias = decoder_up_blocks_1_resnets_1_conv2_bias_to_fp16, dilations = var_407, groups = var_28, pad = hidden_states_23_pad_0, pad_type = hidden_states_23_pad_type_0, strides = var_405, weight = decoder_up_blocks_1_resnets_1_conv2_weight_to_fp16, x = input_103_cast); 536 | tensor var_410_cast = add(x = var_380_cast, y = hidden_states_23_cast); 537 | tensor reshape_60_shape_0 = const()[name = tensor("reshape_60_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 538 | tensor reshape_60_cast = reshape(shape = reshape_60_shape_0, x = var_410_cast); 539 | tensor reduce_mean_45_axes_0 = const()[name = tensor("reduce_mean_45_axes_0"), val = tensor([2, 3, 4])]; 540 | tensor reduce_mean_45_keep_dims_0 = const()[name = tensor("reduce_mean_45_keep_dims_0"), val = tensor(true)]; 541 | tensor reduce_mean_45_cast = reduce_mean(axes = reduce_mean_45_axes_0, keep_dims = reduce_mean_45_keep_dims_0, x = reshape_60_cast); 542 | tensor sub_30_cast = sub(x = reshape_60_cast, y = reduce_mean_45_cast); 543 | tensor square_15_cast = square(x = sub_30_cast); 544 | tensor reduce_mean_47_axes_0 = const()[name = tensor("reduce_mean_47_axes_0"), val = tensor([2, 3, 4])]; 545 | tensor reduce_mean_47_keep_dims_0 = const()[name = tensor("reduce_mean_47_keep_dims_0"), val = tensor(true)]; 546 | tensor reduce_mean_47_cast = reduce_mean(axes = reduce_mean_47_axes_0, keep_dims = reduce_mean_47_keep_dims_0, x = square_15_cast); 547 | tensor add_30_y_0_to_fp16 = const()[name = tensor("add_30_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 548 | tensor add_30_cast = add(x = reduce_mean_47_cast, y = add_30_y_0_to_fp16); 549 | tensor sqrt_15_cast = sqrt(x = add_30_cast); 550 | tensor real_div_15_cast = real_div(x = sub_30_cast, y = sqrt_15_cast); 551 | tensor reshape_61_shape_0 = const()[name = tensor("reshape_61_shape_0"), val = tensor([1, 512, 128, 128])]; 552 | tensor reshape_61_cast = reshape(shape = reshape_61_shape_0, x = real_div_15_cast); 553 | tensor add_31_mean_0_to_fp16 = const()[name = tensor("add_31_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73001408)))]; 554 | tensor add_31_variance_0_to_fp16 = const()[name = tensor("add_31_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73002496)))]; 555 | tensor add_31_gamma_0_to_fp16 = const()[name = tensor("add_31_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73003584)))]; 556 | tensor add_31_beta_0_to_fp16 = const()[name = tensor("add_31_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73004672)))]; 557 | tensor add_31_epsilon_0_to_fp16 = const()[name = tensor("add_31_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 558 | tensor add_31_cast = batch_norm(beta = add_31_beta_0_to_fp16, epsilon = add_31_epsilon_0_to_fp16, gamma = add_31_gamma_0_to_fp16, mean = add_31_mean_0_to_fp16, variance = add_31_variance_0_to_fp16, x = reshape_61_cast); 559 | tensor input_111_cast = silu(x = add_31_cast); 560 | tensor var_423 = const()[name = tensor("op_423"), val = tensor([1, 1])]; 561 | tensor var_425 = const()[name = tensor("op_425"), val = tensor([1, 1])]; 562 | tensor input_113_pad_type_0 = const()[name = tensor("input_113_pad_type_0"), val = tensor("custom")]; 563 | tensor input_113_pad_0 = const()[name = tensor("input_113_pad_0"), val = tensor([1, 1, 1, 1])]; 564 | tensor decoder_up_blocks_1_resnets_2_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_2_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(73005760)))]; 565 | tensor decoder_up_blocks_1_resnets_2_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_2_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77724416)))]; 566 | tensor input_113_cast = conv(bias = decoder_up_blocks_1_resnets_2_conv1_bias_to_fp16, dilations = var_425, groups = var_28, pad = input_113_pad_0, pad_type = input_113_pad_type_0, strides = var_423, weight = decoder_up_blocks_1_resnets_2_conv1_weight_to_fp16, x = input_111_cast); 567 | tensor reshape_64_shape_0 = const()[name = tensor("reshape_64_shape_0"), val = tensor([1, 32, 16, 128, 128])]; 568 | tensor reshape_64_cast = reshape(shape = reshape_64_shape_0, x = input_113_cast); 569 | tensor reduce_mean_48_axes_0 = const()[name = tensor("reduce_mean_48_axes_0"), val = tensor([2, 3, 4])]; 570 | tensor reduce_mean_48_keep_dims_0 = const()[name = tensor("reduce_mean_48_keep_dims_0"), val = tensor(true)]; 571 | tensor reduce_mean_48_cast = reduce_mean(axes = reduce_mean_48_axes_0, keep_dims = reduce_mean_48_keep_dims_0, x = reshape_64_cast); 572 | tensor sub_32_cast = sub(x = reshape_64_cast, y = reduce_mean_48_cast); 573 | tensor square_16_cast = square(x = sub_32_cast); 574 | tensor reduce_mean_50_axes_0 = const()[name = tensor("reduce_mean_50_axes_0"), val = tensor([2, 3, 4])]; 575 | tensor reduce_mean_50_keep_dims_0 = const()[name = tensor("reduce_mean_50_keep_dims_0"), val = tensor(true)]; 576 | tensor reduce_mean_50_cast = reduce_mean(axes = reduce_mean_50_axes_0, keep_dims = reduce_mean_50_keep_dims_0, x = square_16_cast); 577 | tensor add_32_y_0_to_fp16 = const()[name = tensor("add_32_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 578 | tensor add_32_cast = add(x = reduce_mean_50_cast, y = add_32_y_0_to_fp16); 579 | tensor sqrt_16_cast = sqrt(x = add_32_cast); 580 | tensor real_div_16_cast = real_div(x = sub_32_cast, y = sqrt_16_cast); 581 | tensor reshape_65_shape_0 = const()[name = tensor("reshape_65_shape_0"), val = tensor([1, 512, 128, 128])]; 582 | tensor reshape_65_cast = reshape(shape = reshape_65_shape_0, x = real_div_16_cast); 583 | tensor add_33_mean_0_to_fp16 = const()[name = tensor("add_33_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77725504)))]; 584 | tensor add_33_variance_0_to_fp16 = const()[name = tensor("add_33_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77726592)))]; 585 | tensor add_33_gamma_0_to_fp16 = const()[name = tensor("add_33_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77727680)))]; 586 | tensor add_33_beta_0_to_fp16 = const()[name = tensor("add_33_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77728768)))]; 587 | tensor add_33_epsilon_0_to_fp16 = const()[name = tensor("add_33_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 588 | tensor add_33_cast = batch_norm(beta = add_33_beta_0_to_fp16, epsilon = add_33_epsilon_0_to_fp16, gamma = add_33_gamma_0_to_fp16, mean = add_33_mean_0_to_fp16, variance = add_33_variance_0_to_fp16, x = reshape_65_cast); 589 | tensor input_117_cast = silu(x = add_33_cast); 590 | tensor var_435 = const()[name = tensor("op_435"), val = tensor([1, 1])]; 591 | tensor var_437 = const()[name = tensor("op_437"), val = tensor([1, 1])]; 592 | tensor hidden_states_25_pad_type_0 = const()[name = tensor("hidden_states_25_pad_type_0"), val = tensor("custom")]; 593 | tensor hidden_states_25_pad_0 = const()[name = tensor("hidden_states_25_pad_0"), val = tensor([1, 1, 1, 1])]; 594 | tensor decoder_up_blocks_1_resnets_2_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_2_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(77729856)))]; 595 | tensor decoder_up_blocks_1_resnets_2_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_resnets_2_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(82448512)))]; 596 | tensor hidden_states_25_cast = conv(bias = decoder_up_blocks_1_resnets_2_conv2_bias_to_fp16, dilations = var_437, groups = var_28, pad = hidden_states_25_pad_0, pad_type = hidden_states_25_pad_type_0, strides = var_435, weight = decoder_up_blocks_1_resnets_2_conv2_weight_to_fp16, x = input_117_cast); 597 | tensor var_440_cast = add(x = var_410_cast, y = hidden_states_25_cast); 598 | tensor input_121_scale_factor_height_0 = const()[name = tensor("input_121_scale_factor_height_0"), val = tensor(0x1p+1)]; 599 | tensor input_121_scale_factor_width_0 = const()[name = tensor("input_121_scale_factor_width_0"), val = tensor(0x1p+1)]; 600 | tensor input_121_cast = upsample_nearest_neighbor(scale_factor_height = input_121_scale_factor_height_0, scale_factor_width = input_121_scale_factor_width_0, x = var_440_cast); 601 | tensor var_448 = const()[name = tensor("op_448"), val = tensor([1, 1])]; 602 | tensor var_450 = const()[name = tensor("op_450"), val = tensor([1, 1])]; 603 | tensor input_123_pad_type_0 = const()[name = tensor("input_123_pad_type_0"), val = tensor("custom")]; 604 | tensor input_123_pad_0 = const()[name = tensor("input_123_pad_0"), val = tensor([1, 1, 1, 1])]; 605 | tensor decoder_up_blocks_1_upsamplers_0_conv_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_1_upsamplers_0_conv_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(82449600)))]; 606 | tensor decoder_up_blocks_1_upsamplers_0_conv_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_1_upsamplers_0_conv_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87168256)))]; 607 | tensor input_123_cast = conv(bias = decoder_up_blocks_1_upsamplers_0_conv_bias_to_fp16, dilations = var_450, groups = var_28, pad = input_123_pad_0, pad_type = input_123_pad_type_0, strides = var_448, weight = decoder_up_blocks_1_upsamplers_0_conv_weight_to_fp16, x = input_121_cast); 608 | tensor reshape_68_shape_0 = const()[name = tensor("reshape_68_shape_0"), val = tensor([1, 32, 16, 256, 256])]; 609 | tensor reshape_68_cast = reshape(shape = reshape_68_shape_0, x = input_123_cast); 610 | tensor reduce_mean_51_axes_0 = const()[name = tensor("reduce_mean_51_axes_0"), val = tensor([2, 3, 4])]; 611 | tensor reduce_mean_51_keep_dims_0 = const()[name = tensor("reduce_mean_51_keep_dims_0"), val = tensor(true)]; 612 | tensor reduce_mean_51_cast = reduce_mean(axes = reduce_mean_51_axes_0, keep_dims = reduce_mean_51_keep_dims_0, x = reshape_68_cast); 613 | tensor sub_34_cast = sub(x = reshape_68_cast, y = reduce_mean_51_cast); 614 | tensor square_17_cast = square(x = sub_34_cast); 615 | tensor reduce_mean_53_axes_0 = const()[name = tensor("reduce_mean_53_axes_0"), val = tensor([2, 3, 4])]; 616 | tensor reduce_mean_53_keep_dims_0 = const()[name = tensor("reduce_mean_53_keep_dims_0"), val = tensor(true)]; 617 | tensor reduce_mean_53_cast = reduce_mean(axes = reduce_mean_53_axes_0, keep_dims = reduce_mean_53_keep_dims_0, x = square_17_cast); 618 | tensor add_34_y_0_to_fp16 = const()[name = tensor("add_34_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 619 | tensor add_34_cast = add(x = reduce_mean_53_cast, y = add_34_y_0_to_fp16); 620 | tensor sqrt_17_cast = sqrt(x = add_34_cast); 621 | tensor real_div_17_cast = real_div(x = sub_34_cast, y = sqrt_17_cast); 622 | tensor reshape_69_shape_0 = const()[name = tensor("reshape_69_shape_0"), val = tensor([1, 512, 256, 256])]; 623 | tensor reshape_69_cast = reshape(shape = reshape_69_shape_0, x = real_div_17_cast); 624 | tensor add_35_mean_0_to_fp16 = const()[name = tensor("add_35_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87169344)))]; 625 | tensor add_35_variance_0_to_fp16 = const()[name = tensor("add_35_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87170432)))]; 626 | tensor add_35_gamma_0_to_fp16 = const()[name = tensor("add_35_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87171520)))]; 627 | tensor add_35_beta_0_to_fp16 = const()[name = tensor("add_35_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87172608)))]; 628 | tensor add_35_epsilon_0_to_fp16 = const()[name = tensor("add_35_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 629 | tensor add_35_cast = batch_norm(beta = add_35_beta_0_to_fp16, epsilon = add_35_epsilon_0_to_fp16, gamma = add_35_gamma_0_to_fp16, mean = add_35_mean_0_to_fp16, variance = add_35_variance_0_to_fp16, x = reshape_69_cast); 630 | tensor input_127_cast = silu(x = add_35_cast); 631 | tensor var_472 = const()[name = tensor("op_472"), val = tensor([1, 1])]; 632 | tensor var_474 = const()[name = tensor("op_474"), val = tensor([1, 1])]; 633 | tensor input_129_pad_type_0 = const()[name = tensor("input_129_pad_type_0"), val = tensor("custom")]; 634 | tensor input_129_pad_0 = const()[name = tensor("input_129_pad_0"), val = tensor([1, 1, 1, 1])]; 635 | tensor decoder_up_blocks_2_resnets_0_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(87173696)))]; 636 | tensor decoder_up_blocks_2_resnets_0_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89533056)))]; 637 | tensor input_129_cast = conv(bias = decoder_up_blocks_2_resnets_0_conv1_bias_to_fp16, dilations = var_474, groups = var_28, pad = input_129_pad_0, pad_type = input_129_pad_type_0, strides = var_472, weight = decoder_up_blocks_2_resnets_0_conv1_weight_to_fp16, x = input_127_cast); 638 | tensor reshape_72_shape_0 = const()[name = tensor("reshape_72_shape_0"), val = tensor([1, 32, 8, 256, 256])]; 639 | tensor reshape_72_cast = reshape(shape = reshape_72_shape_0, x = input_129_cast); 640 | tensor reduce_mean_54_axes_0 = const()[name = tensor("reduce_mean_54_axes_0"), val = tensor([2, 3, 4])]; 641 | tensor reduce_mean_54_keep_dims_0 = const()[name = tensor("reduce_mean_54_keep_dims_0"), val = tensor(true)]; 642 | tensor reduce_mean_54_cast = reduce_mean(axes = reduce_mean_54_axes_0, keep_dims = reduce_mean_54_keep_dims_0, x = reshape_72_cast); 643 | tensor sub_36_cast = sub(x = reshape_72_cast, y = reduce_mean_54_cast); 644 | tensor square_18_cast = square(x = sub_36_cast); 645 | tensor reduce_mean_56_axes_0 = const()[name = tensor("reduce_mean_56_axes_0"), val = tensor([2, 3, 4])]; 646 | tensor reduce_mean_56_keep_dims_0 = const()[name = tensor("reduce_mean_56_keep_dims_0"), val = tensor(true)]; 647 | tensor reduce_mean_56_cast = reduce_mean(axes = reduce_mean_56_axes_0, keep_dims = reduce_mean_56_keep_dims_0, x = square_18_cast); 648 | tensor add_36_y_0_to_fp16 = const()[name = tensor("add_36_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 649 | tensor add_36_cast = add(x = reduce_mean_56_cast, y = add_36_y_0_to_fp16); 650 | tensor sqrt_18_cast = sqrt(x = add_36_cast); 651 | tensor real_div_18_cast = real_div(x = sub_36_cast, y = sqrt_18_cast); 652 | tensor reshape_73_shape_0 = const()[name = tensor("reshape_73_shape_0"), val = tensor([1, 256, 256, 256])]; 653 | tensor reshape_73_cast = reshape(shape = reshape_73_shape_0, x = real_div_18_cast); 654 | tensor add_37_mean_0_to_fp16 = const()[name = tensor("add_37_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89533632)))]; 655 | tensor add_37_variance_0_to_fp16 = const()[name = tensor("add_37_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89534208)))]; 656 | tensor add_37_gamma_0_to_fp16 = const()[name = tensor("add_37_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89534784)))]; 657 | tensor add_37_beta_0_to_fp16 = const()[name = tensor("add_37_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89535360)))]; 658 | tensor add_37_epsilon_0_to_fp16 = const()[name = tensor("add_37_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 659 | tensor add_37_cast = batch_norm(beta = add_37_beta_0_to_fp16, epsilon = add_37_epsilon_0_to_fp16, gamma = add_37_gamma_0_to_fp16, mean = add_37_mean_0_to_fp16, variance = add_37_variance_0_to_fp16, x = reshape_73_cast); 660 | tensor input_133_cast = silu(x = add_37_cast); 661 | tensor var_484 = const()[name = tensor("op_484"), val = tensor([1, 1])]; 662 | tensor var_486 = const()[name = tensor("op_486"), val = tensor([1, 1])]; 663 | tensor hidden_states_29_pad_type_0 = const()[name = tensor("hidden_states_29_pad_type_0"), val = tensor("custom")]; 664 | tensor hidden_states_29_pad_0 = const()[name = tensor("hidden_states_29_pad_0"), val = tensor([1, 1, 1, 1])]; 665 | tensor decoder_up_blocks_2_resnets_0_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(89535936)))]; 666 | tensor decoder_up_blocks_2_resnets_0_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90715648)))]; 667 | tensor hidden_states_29_cast = conv(bias = decoder_up_blocks_2_resnets_0_conv2_bias_to_fp16, dilations = var_486, groups = var_28, pad = hidden_states_29_pad_0, pad_type = hidden_states_29_pad_type_0, strides = var_484, weight = decoder_up_blocks_2_resnets_0_conv2_weight_to_fp16, x = input_133_cast); 668 | tensor var_491 = const()[name = tensor("op_491"), val = tensor([1, 1])]; 669 | tensor var_493 = const()[name = tensor("op_493"), val = tensor([1, 1])]; 670 | tensor input_tensor_1_pad_type_0 = const()[name = tensor("input_tensor_1_pad_type_0"), val = tensor("custom")]; 671 | tensor input_tensor_1_pad_0 = const()[name = tensor("input_tensor_1_pad_0"), val = tensor([0, 0, 0, 0])]; 672 | tensor decoder_up_blocks_2_resnets_0_conv_shortcut_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv_shortcut_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90716224)))]; 673 | tensor decoder_up_blocks_2_resnets_0_conv_shortcut_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_0_conv_shortcut_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90978432)))]; 674 | tensor input_tensor_1_cast = conv(bias = decoder_up_blocks_2_resnets_0_conv_shortcut_bias_to_fp16, dilations = var_493, groups = var_28, pad = input_tensor_1_pad_0, pad_type = input_tensor_1_pad_type_0, strides = var_491, weight = decoder_up_blocks_2_resnets_0_conv_shortcut_weight_to_fp16, x = input_123_cast); 675 | tensor var_496_cast = add(x = input_tensor_1_cast, y = hidden_states_29_cast); 676 | tensor reshape_76_shape_0 = const()[name = tensor("reshape_76_shape_0"), val = tensor([1, 32, 8, 256, 256])]; 677 | tensor reshape_76_cast = reshape(shape = reshape_76_shape_0, x = var_496_cast); 678 | tensor reduce_mean_57_axes_0 = const()[name = tensor("reduce_mean_57_axes_0"), val = tensor([2, 3, 4])]; 679 | tensor reduce_mean_57_keep_dims_0 = const()[name = tensor("reduce_mean_57_keep_dims_0"), val = tensor(true)]; 680 | tensor reduce_mean_57_cast = reduce_mean(axes = reduce_mean_57_axes_0, keep_dims = reduce_mean_57_keep_dims_0, x = reshape_76_cast); 681 | tensor sub_38_cast = sub(x = reshape_76_cast, y = reduce_mean_57_cast); 682 | tensor square_19_cast = square(x = sub_38_cast); 683 | tensor reduce_mean_59_axes_0 = const()[name = tensor("reduce_mean_59_axes_0"), val = tensor([2, 3, 4])]; 684 | tensor reduce_mean_59_keep_dims_0 = const()[name = tensor("reduce_mean_59_keep_dims_0"), val = tensor(true)]; 685 | tensor reduce_mean_59_cast = reduce_mean(axes = reduce_mean_59_axes_0, keep_dims = reduce_mean_59_keep_dims_0, x = square_19_cast); 686 | tensor add_38_y_0_to_fp16 = const()[name = tensor("add_38_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 687 | tensor add_38_cast = add(x = reduce_mean_59_cast, y = add_38_y_0_to_fp16); 688 | tensor sqrt_19_cast = sqrt(x = add_38_cast); 689 | tensor real_div_19_cast = real_div(x = sub_38_cast, y = sqrt_19_cast); 690 | tensor reshape_77_shape_0 = const()[name = tensor("reshape_77_shape_0"), val = tensor([1, 256, 256, 256])]; 691 | tensor reshape_77_cast = reshape(shape = reshape_77_shape_0, x = real_div_19_cast); 692 | tensor add_39_mean_0_to_fp16 = const()[name = tensor("add_39_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90979008)))]; 693 | tensor add_39_variance_0_to_fp16 = const()[name = tensor("add_39_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90979584)))]; 694 | tensor add_39_gamma_0_to_fp16 = const()[name = tensor("add_39_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90980160)))]; 695 | tensor add_39_beta_0_to_fp16 = const()[name = tensor("add_39_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90980736)))]; 696 | tensor add_39_epsilon_0_to_fp16 = const()[name = tensor("add_39_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 697 | tensor add_39_cast = batch_norm(beta = add_39_beta_0_to_fp16, epsilon = add_39_epsilon_0_to_fp16, gamma = add_39_gamma_0_to_fp16, mean = add_39_mean_0_to_fp16, variance = add_39_variance_0_to_fp16, x = reshape_77_cast); 698 | tensor input_141_cast = silu(x = add_39_cast); 699 | tensor var_509 = const()[name = tensor("op_509"), val = tensor([1, 1])]; 700 | tensor var_511 = const()[name = tensor("op_511"), val = tensor([1, 1])]; 701 | tensor input_143_pad_type_0 = const()[name = tensor("input_143_pad_type_0"), val = tensor("custom")]; 702 | tensor input_143_pad_0 = const()[name = tensor("input_143_pad_0"), val = tensor([1, 1, 1, 1])]; 703 | tensor decoder_up_blocks_2_resnets_1_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_1_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(90981312)))]; 704 | tensor decoder_up_blocks_2_resnets_1_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_1_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92161024)))]; 705 | tensor input_143_cast = conv(bias = decoder_up_blocks_2_resnets_1_conv1_bias_to_fp16, dilations = var_511, groups = var_28, pad = input_143_pad_0, pad_type = input_143_pad_type_0, strides = var_509, weight = decoder_up_blocks_2_resnets_1_conv1_weight_to_fp16, x = input_141_cast); 706 | tensor reshape_80_shape_0 = const()[name = tensor("reshape_80_shape_0"), val = tensor([1, 32, 8, 256, 256])]; 707 | tensor reshape_80_cast = reshape(shape = reshape_80_shape_0, x = input_143_cast); 708 | tensor reduce_mean_60_axes_0 = const()[name = tensor("reduce_mean_60_axes_0"), val = tensor([2, 3, 4])]; 709 | tensor reduce_mean_60_keep_dims_0 = const()[name = tensor("reduce_mean_60_keep_dims_0"), val = tensor(true)]; 710 | tensor reduce_mean_60_cast = reduce_mean(axes = reduce_mean_60_axes_0, keep_dims = reduce_mean_60_keep_dims_0, x = reshape_80_cast); 711 | tensor sub_40_cast = sub(x = reshape_80_cast, y = reduce_mean_60_cast); 712 | tensor square_20_cast = square(x = sub_40_cast); 713 | tensor reduce_mean_62_axes_0 = const()[name = tensor("reduce_mean_62_axes_0"), val = tensor([2, 3, 4])]; 714 | tensor reduce_mean_62_keep_dims_0 = const()[name = tensor("reduce_mean_62_keep_dims_0"), val = tensor(true)]; 715 | tensor reduce_mean_62_cast = reduce_mean(axes = reduce_mean_62_axes_0, keep_dims = reduce_mean_62_keep_dims_0, x = square_20_cast); 716 | tensor add_40_y_0_to_fp16 = const()[name = tensor("add_40_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 717 | tensor add_40_cast = add(x = reduce_mean_62_cast, y = add_40_y_0_to_fp16); 718 | tensor sqrt_20_cast = sqrt(x = add_40_cast); 719 | tensor real_div_20_cast = real_div(x = sub_40_cast, y = sqrt_20_cast); 720 | tensor reshape_81_shape_0 = const()[name = tensor("reshape_81_shape_0"), val = tensor([1, 256, 256, 256])]; 721 | tensor reshape_81_cast = reshape(shape = reshape_81_shape_0, x = real_div_20_cast); 722 | tensor add_41_mean_0_to_fp16 = const()[name = tensor("add_41_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92161600)))]; 723 | tensor add_41_variance_0_to_fp16 = const()[name = tensor("add_41_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92162176)))]; 724 | tensor add_41_gamma_0_to_fp16 = const()[name = tensor("add_41_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92162752)))]; 725 | tensor add_41_beta_0_to_fp16 = const()[name = tensor("add_41_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92163328)))]; 726 | tensor add_41_epsilon_0_to_fp16 = const()[name = tensor("add_41_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 727 | tensor add_41_cast = batch_norm(beta = add_41_beta_0_to_fp16, epsilon = add_41_epsilon_0_to_fp16, gamma = add_41_gamma_0_to_fp16, mean = add_41_mean_0_to_fp16, variance = add_41_variance_0_to_fp16, x = reshape_81_cast); 728 | tensor input_147_cast = silu(x = add_41_cast); 729 | tensor var_521 = const()[name = tensor("op_521"), val = tensor([1, 1])]; 730 | tensor var_523 = const()[name = tensor("op_523"), val = tensor([1, 1])]; 731 | tensor hidden_states_31_pad_type_0 = const()[name = tensor("hidden_states_31_pad_type_0"), val = tensor("custom")]; 732 | tensor hidden_states_31_pad_0 = const()[name = tensor("hidden_states_31_pad_0"), val = tensor([1, 1, 1, 1])]; 733 | tensor decoder_up_blocks_2_resnets_1_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_1_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(92163904)))]; 734 | tensor decoder_up_blocks_2_resnets_1_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_1_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93343616)))]; 735 | tensor hidden_states_31_cast = conv(bias = decoder_up_blocks_2_resnets_1_conv2_bias_to_fp16, dilations = var_523, groups = var_28, pad = hidden_states_31_pad_0, pad_type = hidden_states_31_pad_type_0, strides = var_521, weight = decoder_up_blocks_2_resnets_1_conv2_weight_to_fp16, x = input_147_cast); 736 | tensor var_526_cast = add(x = var_496_cast, y = hidden_states_31_cast); 737 | tensor reshape_84_shape_0 = const()[name = tensor("reshape_84_shape_0"), val = tensor([1, 32, 8, 256, 256])]; 738 | tensor reshape_84_cast = reshape(shape = reshape_84_shape_0, x = var_526_cast); 739 | tensor reduce_mean_63_axes_0 = const()[name = tensor("reduce_mean_63_axes_0"), val = tensor([2, 3, 4])]; 740 | tensor reduce_mean_63_keep_dims_0 = const()[name = tensor("reduce_mean_63_keep_dims_0"), val = tensor(true)]; 741 | tensor reduce_mean_63_cast = reduce_mean(axes = reduce_mean_63_axes_0, keep_dims = reduce_mean_63_keep_dims_0, x = reshape_84_cast); 742 | tensor sub_42_cast = sub(x = reshape_84_cast, y = reduce_mean_63_cast); 743 | tensor square_21_cast = square(x = sub_42_cast); 744 | tensor reduce_mean_65_axes_0 = const()[name = tensor("reduce_mean_65_axes_0"), val = tensor([2, 3, 4])]; 745 | tensor reduce_mean_65_keep_dims_0 = const()[name = tensor("reduce_mean_65_keep_dims_0"), val = tensor(true)]; 746 | tensor reduce_mean_65_cast = reduce_mean(axes = reduce_mean_65_axes_0, keep_dims = reduce_mean_65_keep_dims_0, x = square_21_cast); 747 | tensor add_42_y_0_to_fp16 = const()[name = tensor("add_42_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 748 | tensor add_42_cast = add(x = reduce_mean_65_cast, y = add_42_y_0_to_fp16); 749 | tensor sqrt_21_cast = sqrt(x = add_42_cast); 750 | tensor real_div_21_cast = real_div(x = sub_42_cast, y = sqrt_21_cast); 751 | tensor reshape_85_shape_0 = const()[name = tensor("reshape_85_shape_0"), val = tensor([1, 256, 256, 256])]; 752 | tensor reshape_85_cast = reshape(shape = reshape_85_shape_0, x = real_div_21_cast); 753 | tensor add_43_mean_0_to_fp16 = const()[name = tensor("add_43_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93344192)))]; 754 | tensor add_43_variance_0_to_fp16 = const()[name = tensor("add_43_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93344768)))]; 755 | tensor add_43_gamma_0_to_fp16 = const()[name = tensor("add_43_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93345344)))]; 756 | tensor add_43_beta_0_to_fp16 = const()[name = tensor("add_43_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93345920)))]; 757 | tensor add_43_epsilon_0_to_fp16 = const()[name = tensor("add_43_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 758 | tensor add_43_cast = batch_norm(beta = add_43_beta_0_to_fp16, epsilon = add_43_epsilon_0_to_fp16, gamma = add_43_gamma_0_to_fp16, mean = add_43_mean_0_to_fp16, variance = add_43_variance_0_to_fp16, x = reshape_85_cast); 759 | tensor input_155_cast = silu(x = add_43_cast); 760 | tensor var_539 = const()[name = tensor("op_539"), val = tensor([1, 1])]; 761 | tensor var_541 = const()[name = tensor("op_541"), val = tensor([1, 1])]; 762 | tensor input_157_pad_type_0 = const()[name = tensor("input_157_pad_type_0"), val = tensor("custom")]; 763 | tensor input_157_pad_0 = const()[name = tensor("input_157_pad_0"), val = tensor([1, 1, 1, 1])]; 764 | tensor decoder_up_blocks_2_resnets_2_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_2_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(93346496)))]; 765 | tensor decoder_up_blocks_2_resnets_2_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_2_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94526208)))]; 766 | tensor input_157_cast = conv(bias = decoder_up_blocks_2_resnets_2_conv1_bias_to_fp16, dilations = var_541, groups = var_28, pad = input_157_pad_0, pad_type = input_157_pad_type_0, strides = var_539, weight = decoder_up_blocks_2_resnets_2_conv1_weight_to_fp16, x = input_155_cast); 767 | tensor reshape_88_shape_0 = const()[name = tensor("reshape_88_shape_0"), val = tensor([1, 32, 8, 256, 256])]; 768 | tensor reshape_88_cast = reshape(shape = reshape_88_shape_0, x = input_157_cast); 769 | tensor reduce_mean_66_axes_0 = const()[name = tensor("reduce_mean_66_axes_0"), val = tensor([2, 3, 4])]; 770 | tensor reduce_mean_66_keep_dims_0 = const()[name = tensor("reduce_mean_66_keep_dims_0"), val = tensor(true)]; 771 | tensor reduce_mean_66_cast = reduce_mean(axes = reduce_mean_66_axes_0, keep_dims = reduce_mean_66_keep_dims_0, x = reshape_88_cast); 772 | tensor sub_44_cast = sub(x = reshape_88_cast, y = reduce_mean_66_cast); 773 | tensor square_22_cast = square(x = sub_44_cast); 774 | tensor reduce_mean_68_axes_0 = const()[name = tensor("reduce_mean_68_axes_0"), val = tensor([2, 3, 4])]; 775 | tensor reduce_mean_68_keep_dims_0 = const()[name = tensor("reduce_mean_68_keep_dims_0"), val = tensor(true)]; 776 | tensor reduce_mean_68_cast = reduce_mean(axes = reduce_mean_68_axes_0, keep_dims = reduce_mean_68_keep_dims_0, x = square_22_cast); 777 | tensor add_44_y_0_to_fp16 = const()[name = tensor("add_44_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 778 | tensor add_44_cast = add(x = reduce_mean_68_cast, y = add_44_y_0_to_fp16); 779 | tensor sqrt_22_cast = sqrt(x = add_44_cast); 780 | tensor real_div_22_cast = real_div(x = sub_44_cast, y = sqrt_22_cast); 781 | tensor reshape_89_shape_0 = const()[name = tensor("reshape_89_shape_0"), val = tensor([1, 256, 256, 256])]; 782 | tensor reshape_89_cast = reshape(shape = reshape_89_shape_0, x = real_div_22_cast); 783 | tensor add_45_mean_0_to_fp16 = const()[name = tensor("add_45_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94526784)))]; 784 | tensor add_45_variance_0_to_fp16 = const()[name = tensor("add_45_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94527360)))]; 785 | tensor add_45_gamma_0_to_fp16 = const()[name = tensor("add_45_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94527936)))]; 786 | tensor add_45_beta_0_to_fp16 = const()[name = tensor("add_45_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94528512)))]; 787 | tensor add_45_epsilon_0_to_fp16 = const()[name = tensor("add_45_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 788 | tensor add_45_cast = batch_norm(beta = add_45_beta_0_to_fp16, epsilon = add_45_epsilon_0_to_fp16, gamma = add_45_gamma_0_to_fp16, mean = add_45_mean_0_to_fp16, variance = add_45_variance_0_to_fp16, x = reshape_89_cast); 789 | tensor input_161_cast = silu(x = add_45_cast); 790 | tensor var_551 = const()[name = tensor("op_551"), val = tensor([1, 1])]; 791 | tensor var_553 = const()[name = tensor("op_553"), val = tensor([1, 1])]; 792 | tensor hidden_states_33_pad_type_0 = const()[name = tensor("hidden_states_33_pad_type_0"), val = tensor("custom")]; 793 | tensor hidden_states_33_pad_0 = const()[name = tensor("hidden_states_33_pad_0"), val = tensor([1, 1, 1, 1])]; 794 | tensor decoder_up_blocks_2_resnets_2_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_2_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(94529088)))]; 795 | tensor decoder_up_blocks_2_resnets_2_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_resnets_2_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(95708800)))]; 796 | tensor hidden_states_33_cast = conv(bias = decoder_up_blocks_2_resnets_2_conv2_bias_to_fp16, dilations = var_553, groups = var_28, pad = hidden_states_33_pad_0, pad_type = hidden_states_33_pad_type_0, strides = var_551, weight = decoder_up_blocks_2_resnets_2_conv2_weight_to_fp16, x = input_161_cast); 797 | tensor var_556_cast = add(x = var_526_cast, y = hidden_states_33_cast); 798 | tensor input_165_scale_factor_height_0 = const()[name = tensor("input_165_scale_factor_height_0"), val = tensor(0x1p+1)]; 799 | tensor input_165_scale_factor_width_0 = const()[name = tensor("input_165_scale_factor_width_0"), val = tensor(0x1p+1)]; 800 | tensor input_165_cast = upsample_nearest_neighbor(scale_factor_height = input_165_scale_factor_height_0, scale_factor_width = input_165_scale_factor_width_0, x = var_556_cast); 801 | tensor var_564 = const()[name = tensor("op_564"), val = tensor([1, 1])]; 802 | tensor var_566 = const()[name = tensor("op_566"), val = tensor([1, 1])]; 803 | tensor input_167_pad_type_0 = const()[name = tensor("input_167_pad_type_0"), val = tensor("custom")]; 804 | tensor input_167_pad_0 = const()[name = tensor("input_167_pad_0"), val = tensor([1, 1, 1, 1])]; 805 | tensor decoder_up_blocks_2_upsamplers_0_conv_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_2_upsamplers_0_conv_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(95709376)))]; 806 | tensor decoder_up_blocks_2_upsamplers_0_conv_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_2_upsamplers_0_conv_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96889088)))]; 807 | tensor input_167_cast = conv(bias = decoder_up_blocks_2_upsamplers_0_conv_bias_to_fp16, dilations = var_566, groups = var_28, pad = input_167_pad_0, pad_type = input_167_pad_type_0, strides = var_564, weight = decoder_up_blocks_2_upsamplers_0_conv_weight_to_fp16, x = input_165_cast); 808 | tensor reshape_92_shape_0 = const()[name = tensor("reshape_92_shape_0"), val = tensor([1, 32, 8, 512, 512])]; 809 | tensor reshape_92_cast = reshape(shape = reshape_92_shape_0, x = input_167_cast); 810 | tensor reduce_mean_69_axes_0 = const()[name = tensor("reduce_mean_69_axes_0"), val = tensor([2, 3, 4])]; 811 | tensor reduce_mean_69_keep_dims_0 = const()[name = tensor("reduce_mean_69_keep_dims_0"), val = tensor(true)]; 812 | tensor reduce_mean_69_cast = reduce_mean(axes = reduce_mean_69_axes_0, keep_dims = reduce_mean_69_keep_dims_0, x = reshape_92_cast); 813 | tensor sub_46_cast = sub(x = reshape_92_cast, y = reduce_mean_69_cast); 814 | tensor square_23_cast = square(x = sub_46_cast); 815 | tensor reduce_mean_71_axes_0 = const()[name = tensor("reduce_mean_71_axes_0"), val = tensor([2, 3, 4])]; 816 | tensor reduce_mean_71_keep_dims_0 = const()[name = tensor("reduce_mean_71_keep_dims_0"), val = tensor(true)]; 817 | tensor reduce_mean_71_cast = reduce_mean(axes = reduce_mean_71_axes_0, keep_dims = reduce_mean_71_keep_dims_0, x = square_23_cast); 818 | tensor add_46_y_0_to_fp16 = const()[name = tensor("add_46_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 819 | tensor add_46_cast = add(x = reduce_mean_71_cast, y = add_46_y_0_to_fp16); 820 | tensor sqrt_23_cast = sqrt(x = add_46_cast); 821 | tensor real_div_23_cast = real_div(x = sub_46_cast, y = sqrt_23_cast); 822 | tensor reshape_93_shape_0 = const()[name = tensor("reshape_93_shape_0"), val = tensor([1, 256, 512, 512])]; 823 | tensor reshape_93_cast = reshape(shape = reshape_93_shape_0, x = real_div_23_cast); 824 | tensor add_47_mean_0_to_fp16 = const()[name = tensor("add_47_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96889664)))]; 825 | tensor add_47_variance_0_to_fp16 = const()[name = tensor("add_47_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96890240)))]; 826 | tensor add_47_gamma_0_to_fp16 = const()[name = tensor("add_47_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96890816)))]; 827 | tensor add_47_beta_0_to_fp16 = const()[name = tensor("add_47_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96891392)))]; 828 | tensor add_47_epsilon_0_to_fp16 = const()[name = tensor("add_47_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 829 | tensor add_47_cast = batch_norm(beta = add_47_beta_0_to_fp16, epsilon = add_47_epsilon_0_to_fp16, gamma = add_47_gamma_0_to_fp16, mean = add_47_mean_0_to_fp16, variance = add_47_variance_0_to_fp16, x = reshape_93_cast); 830 | tensor input_171_cast = silu(x = add_47_cast); 831 | tensor var_586 = const()[name = tensor("op_586"), val = tensor([1, 1])]; 832 | tensor var_588 = const()[name = tensor("op_588"), val = tensor([1, 1])]; 833 | tensor input_173_pad_type_0 = const()[name = tensor("input_173_pad_type_0"), val = tensor("custom")]; 834 | tensor input_173_pad_0 = const()[name = tensor("input_173_pad_0"), val = tensor([1, 1, 1, 1])]; 835 | tensor decoder_up_blocks_3_resnets_0_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(96891968)))]; 836 | tensor decoder_up_blocks_3_resnets_0_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97481856)))]; 837 | tensor input_173_cast = conv(bias = decoder_up_blocks_3_resnets_0_conv1_bias_to_fp16, dilations = var_588, groups = var_28, pad = input_173_pad_0, pad_type = input_173_pad_type_0, strides = var_586, weight = decoder_up_blocks_3_resnets_0_conv1_weight_to_fp16, x = input_171_cast); 838 | tensor reshape_96_shape_0 = const()[name = tensor("reshape_96_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 839 | tensor reshape_96_cast = reshape(shape = reshape_96_shape_0, x = input_173_cast); 840 | tensor reduce_mean_72_axes_0 = const()[name = tensor("reduce_mean_72_axes_0"), val = tensor([2, 3, 4])]; 841 | tensor reduce_mean_72_keep_dims_0 = const()[name = tensor("reduce_mean_72_keep_dims_0"), val = tensor(true)]; 842 | tensor reduce_mean_72_cast = reduce_mean(axes = reduce_mean_72_axes_0, keep_dims = reduce_mean_72_keep_dims_0, x = reshape_96_cast); 843 | tensor sub_48_cast = sub(x = reshape_96_cast, y = reduce_mean_72_cast); 844 | tensor square_24_cast = square(x = sub_48_cast); 845 | tensor reduce_mean_74_axes_0 = const()[name = tensor("reduce_mean_74_axes_0"), val = tensor([2, 3, 4])]; 846 | tensor reduce_mean_74_keep_dims_0 = const()[name = tensor("reduce_mean_74_keep_dims_0"), val = tensor(true)]; 847 | tensor reduce_mean_74_cast = reduce_mean(axes = reduce_mean_74_axes_0, keep_dims = reduce_mean_74_keep_dims_0, x = square_24_cast); 848 | tensor add_48_y_0_to_fp16 = const()[name = tensor("add_48_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 849 | tensor add_48_cast = add(x = reduce_mean_74_cast, y = add_48_y_0_to_fp16); 850 | tensor sqrt_24_cast = sqrt(x = add_48_cast); 851 | tensor real_div_24_cast = real_div(x = sub_48_cast, y = sqrt_24_cast); 852 | tensor reshape_97_shape_0 = const()[name = tensor("reshape_97_shape_0"), val = tensor([1, 128, 512, 512])]; 853 | tensor reshape_97_cast = reshape(shape = reshape_97_shape_0, x = real_div_24_cast); 854 | tensor add_49_mean_0_to_fp16 = const()[name = tensor("add_49_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97482176)))]; 855 | tensor add_49_variance_0_to_fp16 = const()[name = tensor("add_49_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97482496)))]; 856 | tensor add_49_gamma_0_to_fp16 = const()[name = tensor("add_49_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97482816)))]; 857 | tensor add_49_beta_0_to_fp16 = const()[name = tensor("add_49_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97483136)))]; 858 | tensor add_49_epsilon_0_to_fp16 = const()[name = tensor("add_49_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 859 | tensor add_49_cast = batch_norm(beta = add_49_beta_0_to_fp16, epsilon = add_49_epsilon_0_to_fp16, gamma = add_49_gamma_0_to_fp16, mean = add_49_mean_0_to_fp16, variance = add_49_variance_0_to_fp16, x = reshape_97_cast); 860 | tensor input_177_cast = silu(x = add_49_cast); 861 | tensor var_598 = const()[name = tensor("op_598"), val = tensor([1, 1])]; 862 | tensor var_600 = const()[name = tensor("op_600"), val = tensor([1, 1])]; 863 | tensor hidden_states_37_pad_type_0 = const()[name = tensor("hidden_states_37_pad_type_0"), val = tensor("custom")]; 864 | tensor hidden_states_37_pad_0 = const()[name = tensor("hidden_states_37_pad_0"), val = tensor([1, 1, 1, 1])]; 865 | tensor decoder_up_blocks_3_resnets_0_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97483456)))]; 866 | tensor decoder_up_blocks_3_resnets_0_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97778432)))]; 867 | tensor hidden_states_37_cast = conv(bias = decoder_up_blocks_3_resnets_0_conv2_bias_to_fp16, dilations = var_600, groups = var_28, pad = hidden_states_37_pad_0, pad_type = hidden_states_37_pad_type_0, strides = var_598, weight = decoder_up_blocks_3_resnets_0_conv2_weight_to_fp16, x = input_177_cast); 868 | tensor var_605 = const()[name = tensor("op_605"), val = tensor([1, 1])]; 869 | tensor var_607 = const()[name = tensor("op_607"), val = tensor([1, 1])]; 870 | tensor input_tensor_pad_type_0 = const()[name = tensor("input_tensor_pad_type_0"), val = tensor("custom")]; 871 | tensor input_tensor_pad_0 = const()[name = tensor("input_tensor_pad_0"), val = tensor([0, 0, 0, 0])]; 872 | tensor decoder_up_blocks_3_resnets_0_conv_shortcut_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv_shortcut_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97778752)))]; 873 | tensor decoder_up_blocks_3_resnets_0_conv_shortcut_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_0_conv_shortcut_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97844352)))]; 874 | tensor input_tensor_cast = conv(bias = decoder_up_blocks_3_resnets_0_conv_shortcut_bias_to_fp16, dilations = var_607, groups = var_28, pad = input_tensor_pad_0, pad_type = input_tensor_pad_type_0, strides = var_605, weight = decoder_up_blocks_3_resnets_0_conv_shortcut_weight_to_fp16, x = input_167_cast); 875 | tensor var_610_cast = add(x = input_tensor_cast, y = hidden_states_37_cast); 876 | tensor reshape_100_shape_0 = const()[name = tensor("reshape_100_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 877 | tensor reshape_100_cast = reshape(shape = reshape_100_shape_0, x = var_610_cast); 878 | tensor reduce_mean_75_axes_0 = const()[name = tensor("reduce_mean_75_axes_0"), val = tensor([2, 3, 4])]; 879 | tensor reduce_mean_75_keep_dims_0 = const()[name = tensor("reduce_mean_75_keep_dims_0"), val = tensor(true)]; 880 | tensor reduce_mean_75_cast = reduce_mean(axes = reduce_mean_75_axes_0, keep_dims = reduce_mean_75_keep_dims_0, x = reshape_100_cast); 881 | tensor sub_50_cast = sub(x = reshape_100_cast, y = reduce_mean_75_cast); 882 | tensor square_25_cast = square(x = sub_50_cast); 883 | tensor reduce_mean_77_axes_0 = const()[name = tensor("reduce_mean_77_axes_0"), val = tensor([2, 3, 4])]; 884 | tensor reduce_mean_77_keep_dims_0 = const()[name = tensor("reduce_mean_77_keep_dims_0"), val = tensor(true)]; 885 | tensor reduce_mean_77_cast = reduce_mean(axes = reduce_mean_77_axes_0, keep_dims = reduce_mean_77_keep_dims_0, x = square_25_cast); 886 | tensor add_50_y_0_to_fp16 = const()[name = tensor("add_50_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 887 | tensor add_50_cast = add(x = reduce_mean_77_cast, y = add_50_y_0_to_fp16); 888 | tensor sqrt_25_cast = sqrt(x = add_50_cast); 889 | tensor real_div_25_cast = real_div(x = sub_50_cast, y = sqrt_25_cast); 890 | tensor reshape_101_shape_0 = const()[name = tensor("reshape_101_shape_0"), val = tensor([1, 128, 512, 512])]; 891 | tensor reshape_101_cast = reshape(shape = reshape_101_shape_0, x = real_div_25_cast); 892 | tensor add_51_mean_0_to_fp16 = const()[name = tensor("add_51_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97844672)))]; 893 | tensor add_51_variance_0_to_fp16 = const()[name = tensor("add_51_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97844992)))]; 894 | tensor add_51_gamma_0_to_fp16 = const()[name = tensor("add_51_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97845312)))]; 895 | tensor add_51_beta_0_to_fp16 = const()[name = tensor("add_51_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97845632)))]; 896 | tensor add_51_epsilon_0_to_fp16 = const()[name = tensor("add_51_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 897 | tensor add_51_cast = batch_norm(beta = add_51_beta_0_to_fp16, epsilon = add_51_epsilon_0_to_fp16, gamma = add_51_gamma_0_to_fp16, mean = add_51_mean_0_to_fp16, variance = add_51_variance_0_to_fp16, x = reshape_101_cast); 898 | tensor input_185_cast = silu(x = add_51_cast); 899 | tensor var_623 = const()[name = tensor("op_623"), val = tensor([1, 1])]; 900 | tensor var_625 = const()[name = tensor("op_625"), val = tensor([1, 1])]; 901 | tensor input_187_pad_type_0 = const()[name = tensor("input_187_pad_type_0"), val = tensor("custom")]; 902 | tensor input_187_pad_0 = const()[name = tensor("input_187_pad_0"), val = tensor([1, 1, 1, 1])]; 903 | tensor decoder_up_blocks_3_resnets_1_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_1_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(97845952)))]; 904 | tensor decoder_up_blocks_3_resnets_1_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_1_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98140928)))]; 905 | tensor input_187_cast = conv(bias = decoder_up_blocks_3_resnets_1_conv1_bias_to_fp16, dilations = var_625, groups = var_28, pad = input_187_pad_0, pad_type = input_187_pad_type_0, strides = var_623, weight = decoder_up_blocks_3_resnets_1_conv1_weight_to_fp16, x = input_185_cast); 906 | tensor reshape_104_shape_0 = const()[name = tensor("reshape_104_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 907 | tensor reshape_104_cast = reshape(shape = reshape_104_shape_0, x = input_187_cast); 908 | tensor reduce_mean_78_axes_0 = const()[name = tensor("reduce_mean_78_axes_0"), val = tensor([2, 3, 4])]; 909 | tensor reduce_mean_78_keep_dims_0 = const()[name = tensor("reduce_mean_78_keep_dims_0"), val = tensor(true)]; 910 | tensor reduce_mean_78_cast = reduce_mean(axes = reduce_mean_78_axes_0, keep_dims = reduce_mean_78_keep_dims_0, x = reshape_104_cast); 911 | tensor sub_52_cast = sub(x = reshape_104_cast, y = reduce_mean_78_cast); 912 | tensor square_26_cast = square(x = sub_52_cast); 913 | tensor reduce_mean_80_axes_0 = const()[name = tensor("reduce_mean_80_axes_0"), val = tensor([2, 3, 4])]; 914 | tensor reduce_mean_80_keep_dims_0 = const()[name = tensor("reduce_mean_80_keep_dims_0"), val = tensor(true)]; 915 | tensor reduce_mean_80_cast = reduce_mean(axes = reduce_mean_80_axes_0, keep_dims = reduce_mean_80_keep_dims_0, x = square_26_cast); 916 | tensor add_52_y_0_to_fp16 = const()[name = tensor("add_52_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 917 | tensor add_52_cast = add(x = reduce_mean_80_cast, y = add_52_y_0_to_fp16); 918 | tensor sqrt_26_cast = sqrt(x = add_52_cast); 919 | tensor real_div_26_cast = real_div(x = sub_52_cast, y = sqrt_26_cast); 920 | tensor reshape_105_shape_0 = const()[name = tensor("reshape_105_shape_0"), val = tensor([1, 128, 512, 512])]; 921 | tensor reshape_105_cast = reshape(shape = reshape_105_shape_0, x = real_div_26_cast); 922 | tensor add_53_mean_0_to_fp16 = const()[name = tensor("add_53_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98141248)))]; 923 | tensor add_53_variance_0_to_fp16 = const()[name = tensor("add_53_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98141568)))]; 924 | tensor add_53_gamma_0_to_fp16 = const()[name = tensor("add_53_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98141888)))]; 925 | tensor add_53_beta_0_to_fp16 = const()[name = tensor("add_53_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98142208)))]; 926 | tensor add_53_epsilon_0_to_fp16 = const()[name = tensor("add_53_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 927 | tensor add_53_cast = batch_norm(beta = add_53_beta_0_to_fp16, epsilon = add_53_epsilon_0_to_fp16, gamma = add_53_gamma_0_to_fp16, mean = add_53_mean_0_to_fp16, variance = add_53_variance_0_to_fp16, x = reshape_105_cast); 928 | tensor input_191_cast = silu(x = add_53_cast); 929 | tensor var_635 = const()[name = tensor("op_635"), val = tensor([1, 1])]; 930 | tensor var_637 = const()[name = tensor("op_637"), val = tensor([1, 1])]; 931 | tensor hidden_states_39_pad_type_0 = const()[name = tensor("hidden_states_39_pad_type_0"), val = tensor("custom")]; 932 | tensor hidden_states_39_pad_0 = const()[name = tensor("hidden_states_39_pad_0"), val = tensor([1, 1, 1, 1])]; 933 | tensor decoder_up_blocks_3_resnets_1_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_1_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98142528)))]; 934 | tensor decoder_up_blocks_3_resnets_1_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_1_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98437504)))]; 935 | tensor hidden_states_39_cast = conv(bias = decoder_up_blocks_3_resnets_1_conv2_bias_to_fp16, dilations = var_637, groups = var_28, pad = hidden_states_39_pad_0, pad_type = hidden_states_39_pad_type_0, strides = var_635, weight = decoder_up_blocks_3_resnets_1_conv2_weight_to_fp16, x = input_191_cast); 936 | tensor var_640_cast = add(x = var_610_cast, y = hidden_states_39_cast); 937 | tensor reshape_108_shape_0 = const()[name = tensor("reshape_108_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 938 | tensor reshape_108_cast = reshape(shape = reshape_108_shape_0, x = var_640_cast); 939 | tensor reduce_mean_81_axes_0 = const()[name = tensor("reduce_mean_81_axes_0"), val = tensor([2, 3, 4])]; 940 | tensor reduce_mean_81_keep_dims_0 = const()[name = tensor("reduce_mean_81_keep_dims_0"), val = tensor(true)]; 941 | tensor reduce_mean_81_cast = reduce_mean(axes = reduce_mean_81_axes_0, keep_dims = reduce_mean_81_keep_dims_0, x = reshape_108_cast); 942 | tensor sub_54_cast = sub(x = reshape_108_cast, y = reduce_mean_81_cast); 943 | tensor square_27_cast = square(x = sub_54_cast); 944 | tensor reduce_mean_83_axes_0 = const()[name = tensor("reduce_mean_83_axes_0"), val = tensor([2, 3, 4])]; 945 | tensor reduce_mean_83_keep_dims_0 = const()[name = tensor("reduce_mean_83_keep_dims_0"), val = tensor(true)]; 946 | tensor reduce_mean_83_cast = reduce_mean(axes = reduce_mean_83_axes_0, keep_dims = reduce_mean_83_keep_dims_0, x = square_27_cast); 947 | tensor add_54_y_0_to_fp16 = const()[name = tensor("add_54_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 948 | tensor add_54_cast = add(x = reduce_mean_83_cast, y = add_54_y_0_to_fp16); 949 | tensor sqrt_27_cast = sqrt(x = add_54_cast); 950 | tensor real_div_27_cast = real_div(x = sub_54_cast, y = sqrt_27_cast); 951 | tensor reshape_109_shape_0 = const()[name = tensor("reshape_109_shape_0"), val = tensor([1, 128, 512, 512])]; 952 | tensor reshape_109_cast = reshape(shape = reshape_109_shape_0, x = real_div_27_cast); 953 | tensor add_55_mean_0_to_fp16 = const()[name = tensor("add_55_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98437824)))]; 954 | tensor add_55_variance_0_to_fp16 = const()[name = tensor("add_55_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98438144)))]; 955 | tensor add_55_gamma_0_to_fp16 = const()[name = tensor("add_55_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98438464)))]; 956 | tensor add_55_beta_0_to_fp16 = const()[name = tensor("add_55_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98438784)))]; 957 | tensor add_55_epsilon_0_to_fp16 = const()[name = tensor("add_55_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 958 | tensor add_55_cast = batch_norm(beta = add_55_beta_0_to_fp16, epsilon = add_55_epsilon_0_to_fp16, gamma = add_55_gamma_0_to_fp16, mean = add_55_mean_0_to_fp16, variance = add_55_variance_0_to_fp16, x = reshape_109_cast); 959 | tensor input_199_cast = silu(x = add_55_cast); 960 | tensor var_653 = const()[name = tensor("op_653"), val = tensor([1, 1])]; 961 | tensor var_655 = const()[name = tensor("op_655"), val = tensor([1, 1])]; 962 | tensor input_201_pad_type_0 = const()[name = tensor("input_201_pad_type_0"), val = tensor("custom")]; 963 | tensor input_201_pad_0 = const()[name = tensor("input_201_pad_0"), val = tensor([1, 1, 1, 1])]; 964 | tensor decoder_up_blocks_3_resnets_2_conv1_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_2_conv1_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98439104)))]; 965 | tensor decoder_up_blocks_3_resnets_2_conv1_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_2_conv1_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98734080)))]; 966 | tensor input_201_cast = conv(bias = decoder_up_blocks_3_resnets_2_conv1_bias_to_fp16, dilations = var_655, groups = var_28, pad = input_201_pad_0, pad_type = input_201_pad_type_0, strides = var_653, weight = decoder_up_blocks_3_resnets_2_conv1_weight_to_fp16, x = input_199_cast); 967 | tensor reshape_112_shape_0 = const()[name = tensor("reshape_112_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 968 | tensor reshape_112_cast = reshape(shape = reshape_112_shape_0, x = input_201_cast); 969 | tensor reduce_mean_84_axes_0 = const()[name = tensor("reduce_mean_84_axes_0"), val = tensor([2, 3, 4])]; 970 | tensor reduce_mean_84_keep_dims_0 = const()[name = tensor("reduce_mean_84_keep_dims_0"), val = tensor(true)]; 971 | tensor reduce_mean_84_cast = reduce_mean(axes = reduce_mean_84_axes_0, keep_dims = reduce_mean_84_keep_dims_0, x = reshape_112_cast); 972 | tensor sub_56_cast = sub(x = reshape_112_cast, y = reduce_mean_84_cast); 973 | tensor square_28_cast = square(x = sub_56_cast); 974 | tensor reduce_mean_86_axes_0 = const()[name = tensor("reduce_mean_86_axes_0"), val = tensor([2, 3, 4])]; 975 | tensor reduce_mean_86_keep_dims_0 = const()[name = tensor("reduce_mean_86_keep_dims_0"), val = tensor(true)]; 976 | tensor reduce_mean_86_cast = reduce_mean(axes = reduce_mean_86_axes_0, keep_dims = reduce_mean_86_keep_dims_0, x = square_28_cast); 977 | tensor add_56_y_0_to_fp16 = const()[name = tensor("add_56_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 978 | tensor add_56_cast = add(x = reduce_mean_86_cast, y = add_56_y_0_to_fp16); 979 | tensor sqrt_28_cast = sqrt(x = add_56_cast); 980 | tensor real_div_28_cast = real_div(x = sub_56_cast, y = sqrt_28_cast); 981 | tensor reshape_113_shape_0 = const()[name = tensor("reshape_113_shape_0"), val = tensor([1, 128, 512, 512])]; 982 | tensor reshape_113_cast = reshape(shape = reshape_113_shape_0, x = real_div_28_cast); 983 | tensor add_57_mean_0_to_fp16 = const()[name = tensor("add_57_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98734400)))]; 984 | tensor add_57_variance_0_to_fp16 = const()[name = tensor("add_57_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98734720)))]; 985 | tensor add_57_gamma_0_to_fp16 = const()[name = tensor("add_57_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98735040)))]; 986 | tensor add_57_beta_0_to_fp16 = const()[name = tensor("add_57_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98735360)))]; 987 | tensor add_57_epsilon_0_to_fp16 = const()[name = tensor("add_57_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 988 | tensor add_57_cast = batch_norm(beta = add_57_beta_0_to_fp16, epsilon = add_57_epsilon_0_to_fp16, gamma = add_57_gamma_0_to_fp16, mean = add_57_mean_0_to_fp16, variance = add_57_variance_0_to_fp16, x = reshape_113_cast); 989 | tensor input_205_cast = silu(x = add_57_cast); 990 | tensor var_665 = const()[name = tensor("op_665"), val = tensor([1, 1])]; 991 | tensor var_667 = const()[name = tensor("op_667"), val = tensor([1, 1])]; 992 | tensor hidden_states_pad_type_0 = const()[name = tensor("hidden_states_pad_type_0"), val = tensor("custom")]; 993 | tensor hidden_states_pad_0 = const()[name = tensor("hidden_states_pad_0"), val = tensor([1, 1, 1, 1])]; 994 | tensor decoder_up_blocks_3_resnets_2_conv2_weight_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_2_conv2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(98735680)))]; 995 | tensor decoder_up_blocks_3_resnets_2_conv2_bias_to_fp16 = const()[name = tensor("decoder_up_blocks_3_resnets_2_conv2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99030656)))]; 996 | tensor hidden_states_cast = conv(bias = decoder_up_blocks_3_resnets_2_conv2_bias_to_fp16, dilations = var_667, groups = var_28, pad = hidden_states_pad_0, pad_type = hidden_states_pad_type_0, strides = var_665, weight = decoder_up_blocks_3_resnets_2_conv2_weight_to_fp16, x = input_205_cast); 997 | tensor var_670_cast = add(x = var_640_cast, y = hidden_states_cast); 998 | tensor reshape_116_shape_0 = const()[name = tensor("reshape_116_shape_0"), val = tensor([1, 32, 4, 512, 512])]; 999 | tensor reshape_116_cast = reshape(shape = reshape_116_shape_0, x = var_670_cast); 1000 | tensor reduce_mean_87_axes_0 = const()[name = tensor("reduce_mean_87_axes_0"), val = tensor([2, 3, 4])]; 1001 | tensor reduce_mean_87_keep_dims_0 = const()[name = tensor("reduce_mean_87_keep_dims_0"), val = tensor(true)]; 1002 | tensor reduce_mean_87_cast = reduce_mean(axes = reduce_mean_87_axes_0, keep_dims = reduce_mean_87_keep_dims_0, x = reshape_116_cast); 1003 | tensor sub_58_cast = sub(x = reshape_116_cast, y = reduce_mean_87_cast); 1004 | tensor square_29_cast = square(x = sub_58_cast); 1005 | tensor reduce_mean_89_axes_0 = const()[name = tensor("reduce_mean_89_axes_0"), val = tensor([2, 3, 4])]; 1006 | tensor reduce_mean_89_keep_dims_0 = const()[name = tensor("reduce_mean_89_keep_dims_0"), val = tensor(true)]; 1007 | tensor reduce_mean_89_cast = reduce_mean(axes = reduce_mean_89_axes_0, keep_dims = reduce_mean_89_keep_dims_0, x = square_29_cast); 1008 | tensor add_58_y_0_to_fp16 = const()[name = tensor("add_58_y_0_to_fp16"), val = tensor(0x1.1p-20)]; 1009 | tensor add_58_cast = add(x = reduce_mean_89_cast, y = add_58_y_0_to_fp16); 1010 | tensor sqrt_29_cast = sqrt(x = add_58_cast); 1011 | tensor real_div_29_cast = real_div(x = sub_58_cast, y = sqrt_29_cast); 1012 | tensor reshape_117_shape_0 = const()[name = tensor("reshape_117_shape_0"), val = tensor([1, 128, 512, 512])]; 1013 | tensor reshape_117_cast = reshape(shape = reshape_117_shape_0, x = real_div_29_cast); 1014 | tensor add_59_mean_0_to_fp16 = const()[name = tensor("add_59_mean_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99030976)))]; 1015 | tensor add_59_variance_0_to_fp16 = const()[name = tensor("add_59_variance_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99031296)))]; 1016 | tensor add_59_gamma_0_to_fp16 = const()[name = tensor("add_59_gamma_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99031616)))]; 1017 | tensor add_59_beta_0_to_fp16 = const()[name = tensor("add_59_beta_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99031936)))]; 1018 | tensor add_59_epsilon_0_to_fp16 = const()[name = tensor("add_59_epsilon_0_to_fp16"), val = tensor(0x1.5p-17)]; 1019 | tensor add_59_cast = batch_norm(beta = add_59_beta_0_to_fp16, epsilon = add_59_epsilon_0_to_fp16, gamma = add_59_gamma_0_to_fp16, mean = add_59_mean_0_to_fp16, variance = add_59_variance_0_to_fp16, x = reshape_117_cast); 1020 | tensor input_cast = silu(x = add_59_cast); 1021 | tensor var_679 = const()[name = tensor("op_679"), val = tensor([1, 1])]; 1022 | tensor var_681 = const()[name = tensor("op_681"), val = tensor([1, 1])]; 1023 | tensor var_683_pad_type_0 = const()[name = tensor("op_683_pad_type_0"), val = tensor("custom")]; 1024 | tensor var_683_pad_0 = const()[name = tensor("op_683_pad_0"), val = tensor([1, 1, 1, 1])]; 1025 | tensor decoder_conv_out_weight_to_fp16 = const()[name = tensor("decoder_conv_out_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(99032256)))]; 1026 | tensor decoder_conv_out_bias_to_fp16 = const()[name = tensor("decoder_conv_out_bias_to_fp16"), val = tensor([0x1.02p-6, -0x1.4ccp-6, -0x1.7bcp-5])]; 1027 | tensor var_683_cast = conv(bias = decoder_conv_out_bias_to_fp16, dilations = var_681, groups = var_28, pad = var_683_pad_0, pad_type = var_683_pad_type_0, strides = var_679, weight = decoder_conv_out_weight_to_fp16, x = input_cast); 1028 | tensor var_683_cast_to_fp32_dtype_0 = const()[name = tensor("op_683_cast_to_fp32_dtype_0"), val = tensor("fp32")]; 1029 | tensor image = cast(dtype = var_683_cast_to_fp32_dtype_0, x = var_683_cast); 1030 | } -> (image); 1031 | } -------------------------------------------------------------------------------- /StableDiffusionSwift/ML Models/VAEDecoder.mlmodelc/weights/weight.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2aa9f90b7ed18d026a354c6921e07880e14ddde41e1aca1b2d40a27b1c7879aa 3 | size 99039232 4 | -------------------------------------------------------------------------------- /StableDiffusionSwift/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /StableDiffusionSwift/StableDiffusionManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StableDiffusionManager.swift 3 | // StableDiffusionSwift 4 | // 5 | // Created by Jia Chen Yee on 17/12/22. 6 | // 7 | 8 | import Foundation 9 | import StableDiffusion 10 | import CoreGraphics 11 | 12 | @MainActor class StableDiffusionManager: ObservableObject { 13 | 14 | struct Image: Identifiable { 15 | var index: Int 16 | var cgImage: CGImage 17 | 18 | var id: Int { index } 19 | } 20 | 21 | @Published var progress: Double = 0 22 | 23 | @Published var images: [Image] = [] 24 | 25 | @Published var isReady = false 26 | 27 | var pipeline: StableDiffusionPipeline! 28 | 29 | init() { 30 | Task(priority: .high) { 31 | let resourceURL = Bundle.main.url(forResource: "ML Models", withExtension: nil)! 32 | 33 | let pipeline = try StableDiffusionPipeline(resourcesAt: resourceURL) 34 | try pipeline.loadResources() 35 | 36 | self.pipeline = pipeline 37 | self.isReady = true 38 | } 39 | } 40 | 41 | func setProgress(progress: StableDiffusionPipeline.Progress) { 42 | self.progress = Double(progress.step + 1) / Double(progress.stepCount + 1) 43 | self.images = progress.currentImages.enumerated().compactMap { (n, image) in 44 | if let image { 45 | return Image(index: n, cgImage: image) 46 | } else { 47 | return nil 48 | } 49 | } 50 | } 51 | 52 | func setImages(currentImages: [CGImage?]) { 53 | self.progress = 1 54 | isReady = true 55 | self.images = currentImages.enumerated().compactMap { (n, image) in 56 | if let image { 57 | return Image(index: n, cgImage: image) 58 | } else { 59 | return nil 60 | } 61 | } 62 | } 63 | 64 | func generateImage(prompt: String, 65 | imageCount: Int = 1, 66 | stepCount: Int = 50, 67 | seed: Int = 0, 68 | disableSafety: Bool = false) { 69 | isReady = false 70 | progress = 0 71 | 72 | Task.detached(priority: .high) { 73 | let images = try await self.pipeline.generateImages(prompt: prompt, 74 | imageCount: imageCount, 75 | stepCount: stepCount, 76 | seed: seed, 77 | disableSafety: disableSafety) { progress in 78 | DispatchQueue.main.async { 79 | self.setProgress(progress: progress) 80 | } 81 | 82 | return true 83 | } 84 | await self.setImages(currentImages: images) 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /StableDiffusionSwift/StableDiffusionSwift.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /StableDiffusionSwift/StableDiffusionSwiftApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StableDiffusionSwiftApp.swift 3 | // StableDiffusionSwift 4 | // 5 | // Created by Jia Chen Yee on 17/12/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct StableDiffusionSwiftApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------