bleam 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/cli.cjs +23 -4
  2. package/dist/cli.d.cts +2 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +23 -4
  5. package/dist/{ui-234Plg7Z.d.cts → ui-Bg11tvlc.d.ts} +7 -7
  6. package/dist/ui.d.ts +1 -1
  7. package/dist/window.d.ts +1 -1
  8. package/package.json +4 -1
  9. package/templates/image-generation/app/index.tsx +1 -1
  10. package/templates/native/.gitattributes +1 -0
  11. package/templates/native/App.tsx +26 -0
  12. package/templates/native/app.json +12 -0
  13. package/templates/native/index.ts +8 -0
  14. package/templates/native/ios/.xcode.env +11 -0
  15. package/templates/native/ios/Bleam/AI/Flux2/Configuration/Flux2Config.swift +288 -0
  16. package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryConfig.swift +233 -0
  17. package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryOptimizationConfig.swift +157 -0
  18. package/templates/native/ios/Bleam/AI/Flux2/Configuration/ModelRegistry.swift +425 -0
  19. package/templates/native/ios/Bleam/AI/Flux2/Configuration/QuantizationConfig.swift +138 -0
  20. package/templates/native/ios/Bleam/AI/Flux2/Configuration/TransformerRepoProfile.swift +59 -0
  21. package/templates/native/ios/Bleam/AI/Flux2/Configuration/VAEConfig.swift +134 -0
  22. package/templates/native/ios/Bleam/AI/Flux2/Flux2Core.swift +55 -0
  23. package/templates/native/ios/Bleam/AI/Flux2/Loading/WeightLoader.swift +1192 -0
  24. package/templates/native/ios/Bleam/AI/Flux2/Pipeline/FluxImageRunner.swift +1282 -0
  25. package/templates/native/ios/Bleam/AI/Flux2/Pipeline/LatentUtils.swift +191 -0
  26. package/templates/native/ios/Bleam/AI/Flux2/Scheduler/FlowMatchEulerScheduler.swift +279 -0
  27. package/templates/native/ios/Bleam/AI/Flux2/Text/KleinTextEncoder.swift +380 -0
  28. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Attention.swift +379 -0
  29. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Embeddings.swift +159 -0
  30. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FeedForward.swift +154 -0
  31. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FusedKernels.swift +198 -0
  32. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2KVCache.swift +36 -0
  33. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Modulation.swift +193 -0
  34. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2ParallelAttention.swift +389 -0
  35. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2RoPE.swift +304 -0
  36. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2SingleBlock.swift +290 -0
  37. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Transformer.swift +530 -0
  38. package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2TransformerBlock.swift +362 -0
  39. package/templates/native/ios/Bleam/AI/Flux2/Utils/Flux2Debug.swift +101 -0
  40. package/templates/native/ios/Bleam/AI/Flux2/Utils/MLXCheckpoint.swift +118 -0
  41. package/templates/native/ios/Bleam/AI/Flux2/Utils/MemoryManager.swift +201 -0
  42. package/templates/native/ios/Bleam/AI/Flux2/VAE/AutoencoderKL.swift +476 -0
  43. package/templates/native/ios/Bleam/AI/Flux2/VAE/ResnetBlock.swift +316 -0
  44. package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEDecoder.swift +120 -0
  45. package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEEncoder.swift +136 -0
  46. package/templates/native/ios/Bleam/AppDelegate.swift +373 -0
  47. package/templates/native/ios/Bleam/Appearance.swift +62 -0
  48. package/templates/native/ios/Bleam/Bridging-Header.h +3 -0
  49. package/templates/native/ios/Bleam/Images.xcassets/AppIcon.appiconset/Contents.json +13 -0
  50. package/templates/native/ios/Bleam/Images.xcassets/Contents.json +6 -0
  51. package/templates/native/ios/Bleam/Info.plist +76 -0
  52. package/templates/native/ios/Bleam/PrivacyInfo.xcprivacy +48 -0
  53. package/templates/native/ios/Bleam/SceneDelegate.swift +58 -0
  54. package/templates/native/ios/Bleam/SplashScreen.storyboard +47 -0
  55. package/templates/native/ios/Bleam/Supporting/Expo.plist +6 -0
  56. package/templates/native/ios/Bleam/bleam.entitlements +10 -0
  57. package/templates/native/ios/Bleam.xcodeproj/project.pbxproj +1146 -0
  58. package/templates/native/ios/Bleam.xcodeproj/xcshareddata/xcschemes/Bleam.xcscheme +88 -0
  59. package/templates/native/ios/GenerationService/GenerationService.entitlements +10 -0
  60. package/templates/native/ios/GenerationService/ImageGenerationRunner.swift +591 -0
  61. package/templates/native/ios/GenerationService/Info.plist +31 -0
  62. package/templates/native/ios/GenerationService/main.swift +165 -0
  63. package/templates/native/ios/PlatformHelper/Info.plist +29 -0
  64. package/templates/native/ios/PlatformHelper/main.swift +335 -0
  65. package/templates/native/ios/Podfile +198 -0
  66. package/templates/native/ios/Podfile.lock +2284 -0
  67. package/templates/native/ios/Podfile.properties.json +5 -0
  68. package/templates/native/ios/Shared/Generation/GenerationServiceProtocol.swift +12 -0
  69. package/templates/native/ios/Shared/Generation/GenerationWorkerProtocol.swift +124 -0
  70. package/templates/native/metro.config.js +6 -0
  71. package/templates/native/modules/bleam-runtime/BleamRuntime.podspec +14 -0
  72. package/templates/native/modules/bleam-runtime/expo-module.config.json +8 -0
  73. package/templates/native/modules/bleam-runtime/ios/AIModule.swift +1258 -0
  74. package/templates/native/modules/bleam-runtime/ios/GenerationContracts.swift +135 -0
  75. package/templates/native/modules/bleam-runtime/ios/PlatformModule.swift +313 -0
  76. package/templates/native/modules/bleam-runtime/package.json +5 -0
  77. package/templates/native/package.json +39 -0
  78. package/templates/native/scripts/build/mlx-frameworks.ts +421 -0
  79. package/templates/native/scripts/start/index.ts +474 -0
  80. package/templates/native/scripts/start/known-failures.ts +20 -0
  81. package/templates/native/scripts/start/loader.ts +76 -0
  82. package/templates/native/scripts/start/native-state.ts +242 -0
  83. package/templates/native/scripts/start/package.json +4 -0
  84. package/templates/native/scripts/start/swift-packages.ts +414 -0
  85. package/templates/native/scripts/start/xcode-formatter.ts +106 -0
  86. package/templates/native/tsconfig.json +14 -0
  87. package/templates/native/yarn.lock +3749 -0
  88. package/dist/ui-BJmXhz9Q.d.ts +0 -92
  89. package/dist/ui-Dd7SXdbg.d.cts +0 -92
  90. package/dist/ui-Ds88eETu.d.ts +0 -92
  91. package/dist/ui-TaqnB5SP.d.ts +0 -92
  92. package/dist/ui-WQvnXL0W.d.ts +0 -92
@@ -0,0 +1,5 @@
1
+ {
2
+ "expo.jsEngine": "hermes",
3
+ "EX_DEV_CLIENT_NETWORK_INSPECTOR": "true",
4
+ "ios.deploymentTarget": "17.0"
5
+ }
@@ -0,0 +1,12 @@
1
+ import Foundation
2
+
3
+ @objc protocol GenerationServiceProtocol {
4
+ func startGeneration(requestData: Data, reply: @escaping (Bool) -> Void)
5
+ func cancelGeneration(reply: @escaping (Bool) -> Void)
6
+ func memoryTelemetry(reply: @escaping (Data?) -> Void)
7
+ func shutdown(reply: @escaping (Bool) -> Void)
8
+ }
9
+
10
+ @objc protocol GenerationServiceClientProtocol {
11
+ func generationWorkerDidEmit(eventData: Data)
12
+ }
@@ -0,0 +1,124 @@
1
+ import Foundation
2
+
3
+ struct GenerationWorkerRequest: Codable, Sendable {
4
+ let jobID: UUID
5
+ let model: String
6
+ let prompt: String
7
+ let sourceImagePath: String?
8
+ let maskImagePath: String?
9
+ let maskMode: String?
10
+ let outpaintWidth: Int?
11
+ let outpaintHeight: Int?
12
+ let outpaintSourceX: Int?
13
+ let outpaintSourceY: Int?
14
+ let outpaintSourceWidth: Int?
15
+ let outpaintSourceHeight: Int?
16
+ let outpaintAutoCrop: Bool?
17
+ let resizeMode: String?
18
+ let maxInputLongSide: Int?
19
+ let referenceImagePaths: [String]
20
+ let referenceInfluences: [Double]?
21
+ let loraPaths: [String]
22
+ let loraScales: [Double]?
23
+ let loraIds: [String]?
24
+ let sigmaSchedule: [Double]?
25
+ let width: Int
26
+ let height: Int
27
+ let steps: Int
28
+ let guidance: Double
29
+ let strength: Double?
30
+ let seed: Int?
31
+ let inputIds: [Int]
32
+ let attentionMask: [Int]
33
+ let modelRoot: String
34
+ let textEncoderPath: String
35
+ let transformerPath: String
36
+ let vaePath: String
37
+ let stagingDirectoryPath: String
38
+ }
39
+
40
+ struct GenerationWorkerEvent: Codable, Sendable {
41
+ enum EventType: String, Codable, Sendable {
42
+ case ready
43
+ case progress
44
+ case completed
45
+ case canceled
46
+ case failed
47
+ case log
48
+ }
49
+
50
+ let type: EventType
51
+ let message: String?
52
+ let currentStep: Int?
53
+ let totalSteps: Int?
54
+ let path: String?
55
+ let width: Int?
56
+ let height: Int?
57
+ let model: String?
58
+ let level: String?
59
+ let category: String?
60
+ let jobID: String?
61
+ let stage: String?
62
+ let metadata: GenerationWorkerMetadata?
63
+
64
+ init(
65
+ type: EventType,
66
+ message: String? = nil,
67
+ currentStep: Int? = nil,
68
+ totalSteps: Int? = nil,
69
+ path: String? = nil,
70
+ width: Int? = nil,
71
+ height: Int? = nil,
72
+ model: String? = nil,
73
+ level: String? = nil,
74
+ category: String? = nil,
75
+ jobID: String? = nil,
76
+ stage: String? = nil,
77
+ metadata: GenerationWorkerMetadata? = nil
78
+ ) {
79
+ self.type = type
80
+ self.message = message
81
+ self.currentStep = currentStep
82
+ self.totalSteps = totalSteps
83
+ self.path = path
84
+ self.width = width
85
+ self.height = height
86
+ self.model = model
87
+ self.level = level
88
+ self.category = category
89
+ self.jobID = jobID
90
+ self.stage = stage
91
+ self.metadata = metadata
92
+ }
93
+ }
94
+
95
+ struct GenerationWorkerFailure: LocalizedError {
96
+ let message: String
97
+ let stage: String?
98
+
99
+ init(message: String, stage: String? = nil) {
100
+ self.message = message
101
+ self.stage = stage
102
+ }
103
+
104
+ var errorDescription: String? { message }
105
+ }
106
+
107
+ struct GenerationWorkerMetadata: Codable, Sendable {
108
+ let model: String
109
+ let width: Int
110
+ let height: Int
111
+ let steps: Int
112
+ let guidance: Double
113
+ let strength: Double?
114
+ let seed: Int?
115
+ let elapsedMs: Int
116
+ let appliedLoRAs: [GenerationWorkerLoRA]?
117
+ let sigmaSchedule: [Double]?
118
+ }
119
+
120
+ struct GenerationWorkerLoRA: Codable, Sendable {
121
+ let id: String?
122
+ let path: String
123
+ let scale: Double
124
+ }
@@ -0,0 +1,6 @@
1
+ // Learn more https://docs.expo.io/guides/customizing-metro
2
+ const { getDefaultConfig } = require('expo/metro-config')
3
+
4
+ const config = getDefaultConfig(__dirname)
5
+
6
+ module.exports = config
@@ -0,0 +1,14 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'BleamRuntime'
3
+ s.version = '0.0.0'
4
+ s.summary = 'Bleam runtime Expo modules'
5
+ s.description = 'Local Expo Modules API surface for the Bleam runtime app.'
6
+ s.homepage = 'https://bleam.dev'
7
+ s.license = { :type => 'MIT' }
8
+ s.author = 'Bleam'
9
+ s.platforms = { :ios => '16.4' }
10
+ s.source = { :git => 'https://github.com/bajedev/bleam.git' }
11
+ s.source_files = 'ios/**/*.{swift}'
12
+ s.dependency 'ExpoModulesCore'
13
+ s.swift_version = '5.0'
14
+ end
@@ -0,0 +1,8 @@
1
+ {
2
+ "platforms": ["apple"],
3
+ "apple": {
4
+ "podspecPath": "BleamRuntime.podspec",
5
+ "swiftModuleName": "BleamRuntime",
6
+ "modules": ["AIModule", "PlatformModule"]
7
+ }
8
+ }