Skip to content

Commit b396f29

Browse files
committed
Small fixes
1 parent 5309aa6 commit b396f29

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

BlazorDiffusion.ServiceInterface/CreativeService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class CreativeService : Service
2929
public const int DefaultImages = 4;
3030
public const int DefaultSteps = 25;
3131

32-
public const int DefaultModeratorImages = 4;
32+
public const int DefaultModeratorImages = 8;
3333
public const int DefaultModeratorSteps = 25;
3434

3535
public const int DefaultMaxWidth = 1280;

BlazorDiffusion/AiServerClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ public async Task<ImageGenerationResponse> GenerateImageAsync(ImageGeneration re
1818
{
1919
var req = request.ToComfy();
2020
var res = await Client.PostAsync(req);
21+
if (res == null)
22+
throw new Exception("Failed to generate image.");
2123
var now = DateTime.UtcNow;
2224
var key = $"{now:yyyy/MM/dd}/{(long)now.TimeOfDay.TotalMilliseconds}";
2325

2426
var results = new List<ImageGenerationResult>();
25-
var seed = (res.Request.Seed ?? 0).ConvertTo<uint>();
27+
var seed = (res?.Request?.Seed ?? 0).ConvertTo<uint>();
2628
foreach (var item in res.Images)
2729
{
2830
var artifactUrl = $"{Client.BaseUri.TrimEnd('/')}/uploads{item.Url}";

0 commit comments

Comments
 (0)