Skip to content

Commit c3fc3f9

Browse files
committed
added support for stability.sd3-5-large
1 parent eba68aa commit c3fc3f9

19 files changed

+87
-17
lines changed

docs/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.2.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.50.0] - **BREAKING CHANGES**
8+
## [0.51.0] - **BREAKING CHANGES**
99

1010
- Module changes:
1111
- Added two new properties to all model documentation objects:
@@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- `CfgScale` parameter maximum adjusted from 10 to 9.9
2525
- Meta
2626
- Removed `meta.llama2-13b-chat-v1` and `meta.llama2-70b-chat-v1` from all functions as Bedrock has EOL these two models. - ***Breaking Change***
27+
- stability.ai
28+
- Updated `Invoke-StabilityAIImageModel` to support new model: `stability.sd3-5-large-v1:0`
2729

2830
## [0.33.0] - **BREAKING CHANGES**
2931

docs/pwshBedrock.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module Name: pwshBedrock
33
Module Guid: b4f9e4dc-0229-44ef-99a1-08be4c5e81f2
44
Download Help Link: NA
5-
Help Version: 0.50.0
5+
Help Version: 0.51.0
66
Locale: en-US
77
---
88

src/Tests/Integration/ConverseAPI.Tests.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ InModuleScope 'pwshBedrock' {
5353
# 'stability.stable-image-ultra-v1:0', # *note: not supported by Converse API
5454
# 'stability.stable-image-core-v1:0' # *note: not supported by Converse API
5555
# 'stability.sd3-large-v1:0' # *note: not supported by Converse API
56+
# 'stability.sd3-5-large-v1:0' # *note: not supported by Converse API
5657
)
5758
}
5859
BeforeAll {

src/Tests/Integration/StabilityAI.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ InModuleScope 'pwshBedrock' {
162162
$eval | Should -Not -BeNullOrEmpty
163163
} #it
164164

165-
It 'should return an image when using image-to-image for <_.ModelId>' -Foreach ($script:stabilityAIModelInfo | Where-Object { $_.ModelID -eq 'stability.sd3-large-v1:0' }) {
165+
It 'should return an image when using image-to-image for <_.ModelId>' -Foreach ($script:stabilityAIModelInfo | Where-Object { $_.ModelID -like '*sd3*' }) {
166166
$ModelID = $_.ModelID
167167
$invokeStabilityAIImageModelSplat = @{
168168
ImagesSavePath = $outFile

src/Tests/Integration/SupportedModels-Checks.Tests.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ Describe 'Supported Models Checks' -Tag Integration {
4949
'stability.stable-diffusion-xl-v1',
5050
'stability.stable-image-ultra-v1:0',
5151
'stability.stable-image-core-v1:0'
52-
'stability.sd3-large-v1:0'
52+
'stability.sd3-large-v1:0',
53+
'stability.sd3-5-large-v1:0'
5354
)
5455
$filesWithAllModelsReferences = @(
5556
'Add-ModelCostEstimate.ps1'

src/Tests/Unit/Public/Get-ModelContext.Tests.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ InModuleScope 'pwshBedrock' {
249249
content = 'test'
250250
}
251251
}
252+
[PSCustomObject]@{
253+
ModelId = 'stability.sd3-5-large-v1:0'
254+
Context = [PSCustomObject]@{
255+
role = 'user'
256+
content = 'test'
257+
}
258+
}
252259
)
253260
}
254261

src/Tests/Unit/Public/Get-ModelTally.Tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ InModuleScope 'pwshBedrock' {
4343

4444
It 'should get the tally for all models' {
4545
$eval = Get-ModelTally -AllModels
46-
$eval.Count | Should -BeExactly 44
46+
$eval.Count | Should -BeExactly 45
4747
foreach ($model in $eval) {
4848
if ($null -ne $model.ImageCount) {
4949
$model.ImageCount | Should -BeExactly 0

src/Tests/Unit/Public/Reset-ModelContext.Tests.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,20 @@ User: "Hi there!
627627
}
628628
)
629629
}
630+
[PSCustomObject]@{
631+
ModelID = 'stability.sd3-5-large-v1:0'
632+
Context = @(
633+
[PSCustomObject]@{
634+
role = 'user'
635+
content = @(
636+
[PSCustomObject]@{
637+
type = 'text'
638+
text = 'SD3 large v1 context'
639+
}
640+
)
641+
}
642+
)
643+
}
630644
)
631645
} #beforeEach
632646

src/pwshBedrock/Imports.ps1

+36
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ $Global:pwshBedRockSessionModelTally = @(
337337
ImageCount = 0
338338
ImageCost = 0
339339
}
340+
[PSCustomObject]@{
341+
ModelId = 'stability.sd3-5-large-v1:0'
342+
ImageCount = 0
343+
ImageCost = 0
344+
}
340345
)
341346

342347
#endregion
@@ -520,6 +525,10 @@ $Global:pwshBedrockModelContext = @(
520525
ModelId = 'stability.sd3-large-v1:0'
521526
Context = New-Object System.Collections.Generic.List[object]
522527
}
528+
[PSCustomObject]@{
529+
ModelId = 'stability.sd3-5-large-v1:0'
530+
Context = New-Object System.Collections.Generic.List[object]
531+
}
523532
)
524533

525534
#endregion
@@ -1691,6 +1700,33 @@ $script:stabilityAIModelInfo = @(
16911700
# OutputTokenCost = 0.012
16921701
# pricing structure is different for image models
16931702
}
1703+
[PSCustomObject]@{
1704+
ProviderName = 'Stability AI'
1705+
ModelName = 'Stable Diffusion 3.5 Large'
1706+
ModelId = 'stability.sd3-5-large-v1:0'
1707+
Model = ''
1708+
Description = 'the most powerful model in the Stable Diffusion family at 8.1 billion parameters, with superior quality and prompt adherence'
1709+
Strength = 'Story boarding, concept art creation, and rapid prototyping of visual effects. typography, intricate compositions, dynamic lighting, vibrant colors, and artistic cohesion.'
1710+
Multilingual = $false
1711+
Text = $false
1712+
Image = $true
1713+
Video = $false
1714+
Document = $false
1715+
Vision = $false
1716+
SystemPrompt = $false
1717+
ToolUse = $false
1718+
ResponseStreamingSupported = $false
1719+
ChatHistorySupported = $false
1720+
InferenceProfile = $false
1721+
ContextWindow = ''
1722+
MaxOutput = ''
1723+
TrainingCutoff = ''
1724+
PayloadLimit = '' #! Couldn't find in documentation
1725+
ImageCost = 0.08
1726+
# InputTokenCost = 0.01
1727+
# OutputTokenCost = 0.012
1728+
# pricing structure is different for image models
1729+
}
16941730
) #ai21ModelInfo
16951731

16961732
#endregion

src/pwshBedrock/Private/Add-ModelCostEstimate.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ function Add-ModelCostEstimate {
9797
'stability.stable-diffusion-xl-v1',
9898
'stability.stable-image-ultra-v1:0',
9999
'stability.stable-image-core-v1:0',
100-
'stability.sd3-large-v1:0'
100+
'stability.sd3-large-v1:0',
101+
'stability.sd3-5-large-v1:0'
101102
)]
102103
[string]$ModelID,
103104

src/pwshBedrock/Public/Get-ModelContext.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function Get-ModelContext {
7878
'stability.stable-image-ultra-v1:0',
7979
'stability.stable-image-core-v1:0',
8080
'stability.sd3-large-v1:0',
81+
'stability.sd3-5-large-v1:0',
8182
'Converse'
8283
)]
8384
[string]$ModelID

src/pwshBedrock/Public/Get-ModelCostEstimate.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ function Get-ModelCostEstimate {
109109
'stability.stable-diffusion-xl-v1',
110110
'stability.stable-image-ultra-v1:0',
111111
'stability.stable-image-core-v1:0',
112-
'stability.sd3-large-v1:0'
112+
'stability.sd3-large-v1:0',
113+
'stability.sd3-5-large-v1:0'
113114
)]
114115
[string]$ModelID
115116
)

src/pwshBedrock/Public/Get-ModelInfo.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ function Get-ModelInfo {
8686
'stability.stable-diffusion-xl-v1',
8787
'stability.stable-image-ultra-v1:0',
8888
'stability.stable-image-core-v1:0',
89-
'stability.sd3-large-v1:0'
89+
'stability.sd3-large-v1:0',
90+
'stability.sd3-5-large-v1:0'
9091
)]
9192
[string]$ModelID,
9293

src/pwshBedrock/Public/Get-ModelTally.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function Get-ModelTally {
8989
'stability.stable-diffusion-xl-v1',
9090
'stability.stable-image-ultra-v1:0',
9191
'stability.stable-image-core-v1:0',
92-
'stability.sd3-large-v1:0'
92+
'stability.sd3-large-v1:0',
93+
'stability.sd3-5-large-v1:0'
9394
)]
9495
[string]$ModelID,
9596

src/pwshBedrock/Public/Invoke-StabilityAIImageModel.ps1

+5-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ function Invoke-StabilityAIImageModel {
184184
[ValidateSet(
185185
'stability.stable-image-core-v1:0',
186186
'stability.stable-image-ultra-v1:0',
187-
'stability.sd3-large-v1:0'
187+
'stability.sd3-large-v1:0',
188+
'stability.sd3-5-large-v1:0'
188189
)]
189190
[string]$ModelID = 'stability.stable-image-core-v1:0',
190191

@@ -244,11 +245,11 @@ function Invoke-StabilityAIImageModel {
244245

245246
#region image-to-image parameters
246247

247-
if ($InitImagePath -and $ModelID -ne 'stability.sd3-large-v1:0') {
248-
Write-Warning -Message 'Only stability.sd3-large-v1:0 supports image-to-image requests.'
248+
if ($InitImagePath -and $ModelID -notlike '*sd3*') {
249+
Write-Warning -Message 'Only stability sd3 models support image-to-image requests.'
249250
throw ('Model {0} does not support image-to-image requests.' -f $ModelID)
250251
}
251-
elseif ($InitImagePath -and $ModelID -eq 'stability.sd3-large-v1:0') {
252+
elseif ($InitImagePath -and $ModelID -like '*sd3*') {
252253
$bodyObj.Add('mode', 'image-to-image')
253254

254255
Write-Debug -Message 'Validating InitImage'

src/pwshBedrock/Public/Reset-ModelContext.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ function Reset-ModelContext {
8383
'stability.stable-diffusion-xl-v1',
8484
'stability.stable-image-ultra-v1:0',
8585
'stability.stable-image-core-v1:0',
86-
'stability.sd3-large-v1:0'
86+
'stability.sd3-large-v1:0',
87+
'stability.sd3-5-large-v1:0'
8788
)]
8889
[string]$ModelID,
8990

src/pwshBedrock/Public/Reset-ModelTally.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ function Reset-ModelTally {
8787
'stability.stable-diffusion-xl-v1',
8888
'stability.stable-image-ultra-v1:0',
8989
'stability.stable-image-core-v1:0',
90-
'stability.sd3-large-v1:0'
90+
'stability.sd3-large-v1:0',
91+
'stability.sd3-5-large-v1:0'
9192
)]
9293
[string]$ModelID,
9394

src/pwshBedrock/Public/Save-ModelContext.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ function Save-ModelContext {
7575
'stability.stable-diffusion-xl-v1',
7676
'stability.stable-image-ultra-v1:0',
7777
'stability.stable-image-core-v1:0',
78-
'stability.sd3-large-v1:0'
78+
'stability.sd3-large-v1:0',
79+
'stability.sd3-5-large-v1:0'
7980
)]
8081
[string]$ModelID,
8182

src/pwshBedrock/pwshBedrock.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'pwshBedrock.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.50.0'
15+
ModuleVersion = '0.51.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

0 commit comments

Comments
 (0)