bleam 0.0.8 → 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.
- package/dist/cli.cjs +23 -4
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +23 -4
- package/dist/{ui-Ce-pnUUA.d.ts → ui-Bg11tvlc.d.ts} +7 -7
- package/dist/ui.d.ts +1 -1
- package/dist/window.d.ts +1 -1
- package/package.json +4 -1
- package/templates/image-generation/app/index.tsx +1 -1
- package/templates/native/.gitattributes +1 -0
- package/templates/native/App.tsx +26 -0
- package/templates/native/app.json +12 -0
- package/templates/native/index.ts +8 -0
- package/templates/native/ios/.xcode.env +11 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/Flux2Config.swift +288 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryConfig.swift +233 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryOptimizationConfig.swift +157 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/ModelRegistry.swift +425 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/QuantizationConfig.swift +138 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/TransformerRepoProfile.swift +59 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/VAEConfig.swift +134 -0
- package/templates/native/ios/Bleam/AI/Flux2/Flux2Core.swift +55 -0
- package/templates/native/ios/Bleam/AI/Flux2/Loading/WeightLoader.swift +1192 -0
- package/templates/native/ios/Bleam/AI/Flux2/Pipeline/FluxImageRunner.swift +1282 -0
- package/templates/native/ios/Bleam/AI/Flux2/Pipeline/LatentUtils.swift +191 -0
- package/templates/native/ios/Bleam/AI/Flux2/Scheduler/FlowMatchEulerScheduler.swift +279 -0
- package/templates/native/ios/Bleam/AI/Flux2/Text/KleinTextEncoder.swift +380 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Attention.swift +379 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Embeddings.swift +159 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FeedForward.swift +154 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FusedKernels.swift +198 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2KVCache.swift +36 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Modulation.swift +193 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2ParallelAttention.swift +389 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2RoPE.swift +304 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2SingleBlock.swift +290 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Transformer.swift +530 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2TransformerBlock.swift +362 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/Flux2Debug.swift +101 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/MLXCheckpoint.swift +118 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/MemoryManager.swift +201 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/AutoencoderKL.swift +476 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/ResnetBlock.swift +316 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEDecoder.swift +120 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEEncoder.swift +136 -0
- package/templates/native/ios/Bleam/AppDelegate.swift +373 -0
- package/templates/native/ios/Bleam/Appearance.swift +62 -0
- package/templates/native/ios/Bleam/Bridging-Header.h +3 -0
- package/templates/native/ios/Bleam/Images.xcassets/AppIcon.appiconset/Contents.json +13 -0
- package/templates/native/ios/Bleam/Images.xcassets/Contents.json +6 -0
- package/templates/native/ios/Bleam/Info.plist +76 -0
- package/templates/native/ios/Bleam/PrivacyInfo.xcprivacy +48 -0
- package/templates/native/ios/Bleam/SceneDelegate.swift +58 -0
- package/templates/native/ios/Bleam/SplashScreen.storyboard +47 -0
- package/templates/native/ios/Bleam/Supporting/Expo.plist +6 -0
- package/templates/native/ios/Bleam/bleam.entitlements +10 -0
- package/templates/native/ios/Bleam.xcodeproj/project.pbxproj +1146 -0
- package/templates/native/ios/Bleam.xcodeproj/xcshareddata/xcschemes/Bleam.xcscheme +88 -0
- package/templates/native/ios/GenerationService/GenerationService.entitlements +10 -0
- package/templates/native/ios/GenerationService/ImageGenerationRunner.swift +591 -0
- package/templates/native/ios/GenerationService/Info.plist +31 -0
- package/templates/native/ios/GenerationService/main.swift +165 -0
- package/templates/native/ios/PlatformHelper/Info.plist +29 -0
- package/templates/native/ios/PlatformHelper/main.swift +335 -0
- package/templates/native/ios/Podfile +198 -0
- package/templates/native/ios/Podfile.lock +2284 -0
- package/templates/native/ios/Podfile.properties.json +5 -0
- package/templates/native/ios/Shared/Generation/GenerationServiceProtocol.swift +12 -0
- package/templates/native/ios/Shared/Generation/GenerationWorkerProtocol.swift +124 -0
- package/templates/native/metro.config.js +6 -0
- package/templates/native/modules/bleam-runtime/BleamRuntime.podspec +14 -0
- package/templates/native/modules/bleam-runtime/expo-module.config.json +8 -0
- package/templates/native/modules/bleam-runtime/ios/AIModule.swift +1258 -0
- package/templates/native/modules/bleam-runtime/ios/GenerationContracts.swift +135 -0
- package/templates/native/modules/bleam-runtime/ios/PlatformModule.swift +313 -0
- package/templates/native/modules/bleam-runtime/package.json +5 -0
- package/templates/native/package.json +39 -0
- package/templates/native/scripts/build/mlx-frameworks.ts +421 -0
- package/templates/native/scripts/start/index.ts +474 -0
- package/templates/native/scripts/start/known-failures.ts +20 -0
- package/templates/native/scripts/start/loader.ts +76 -0
- package/templates/native/scripts/start/native-state.ts +242 -0
- package/templates/native/scripts/start/package.json +4 -0
- package/templates/native/scripts/start/swift-packages.ts +414 -0
- package/templates/native/scripts/start/xcode-formatter.ts +106 -0
- package/templates/native/tsconfig.json +14 -0
- package/templates/native/yarn.lock +3749 -0
|
@@ -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,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
|