Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class ImageToImageUsingImageStrengthRequestBodyJsonConverter : global::Sy
}

var __score0 = 0;
if (__jsonProps.Contains("text_prompts")) __score0++;
if (__jsonProps.Contains("image_strength")) __score0++;
if (__jsonProps.Contains("init_image")) __score0++;
if (__jsonProps.Contains("init_image_mode")) __score0++;
if (__jsonProps.Contains("image_strength")) __score0++;
if (__jsonProps.Contains("text_prompts")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("cfg_scale")) __score1++;
if (__jsonProps.Contains("clip_guidance_preset")) __score1++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class ImageToImageUsingStepScheduleRequestBodyJsonConverter : global::Sys
}

var __score0 = 0;
if (__jsonProps.Contains("text_prompts")) __score0++;
if (__jsonProps.Contains("init_image")) __score0++;
if (__jsonProps.Contains("init_image_mode")) __score0++;
if (__jsonProps.Contains("step_schedule_start")) __score0++;
if (__jsonProps.Contains("step_schedule_end")) __score0++;
if (__jsonProps.Contains("step_schedule_start")) __score0++;
if (__jsonProps.Contains("text_prompts")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("cfg_scale")) __score1++;
if (__jsonProps.Contains("clip_guidance_preset")) __score1++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class MaskingUsingInitImageAlphaRequestBodyJsonConverter : global::System
}

var __score0 = 0;
if (__jsonProps.Contains("text_prompts")) __score0++;
if (__jsonProps.Contains("init_image")) __score0++;
if (__jsonProps.Contains("mask_source")) __score0++;
if (__jsonProps.Contains("text_prompts")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("cfg_scale")) __score1++;
if (__jsonProps.Contains("clip_guidance_preset")) __score1++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class MaskingUsingMaskImageRequestBodyJsonConverter : global::System.Text
}

var __score0 = 0;
if (__jsonProps.Contains("text_prompts")) __score0++;
if (__jsonProps.Contains("init_image")) __score0++;
if (__jsonProps.Contains("mask_source")) __score0++;
if (__jsonProps.Contains("mask_image")) __score0++;
if (__jsonProps.Contains("mask_source")) __score0++;
if (__jsonProps.Contains("text_prompts")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("cfg_scale")) __score1++;
if (__jsonProps.Contains("clip_guidance_preset")) __score1++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class TextToImageRequestBodyJsonConverter : global::System.Text.Json.Seri

var __score0 = 0;
if (__jsonProps.Contains("height")) __score0++;
if (__jsonProps.Contains("width")) __score0++;
if (__jsonProps.Contains("text_prompts")) __score0++;
if (__jsonProps.Contains("width")) __score0++;
var __score1 = 0;
if (__jsonProps.Contains("cfg_scale")) __score1++;
if (__jsonProps.Contains("clip_guidance_preset")) __score1++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public enum FinishReason
/// <summary>
///
/// </summary>
Success,
ContentFiltered,
/// <summary>
///
/// </summary>
Error,
/// <summary>
///
/// </summary>
ContentFiltered,
Success,
}

/// <summary>
Expand All @@ -38,9 +38,9 @@ public static string ToValueString(this FinishReason value)
{
return value switch
{
FinishReason.Success => "SUCCESS",
FinishReason.Error => "ERROR",
FinishReason.ContentFiltered => "CONTENT_FILTERED",
FinishReason.Error => "ERROR",
FinishReason.Success => "SUCCESS",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -51,9 +51,9 @@ public static string ToValueString(this FinishReason value)
{
return value switch
{
"SUCCESS" => FinishReason.Success,
"ERROR" => FinishReason.Error,
"CONTENT_FILTERED" => FinishReason.ContentFiltered,
"ERROR" => FinishReason.Error,
"SUCCESS" => FinishReason.Success,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public enum ImageFinishReason
/// <summary>
///
/// </summary>
Success,
ContentFiltered,
/// <summary>
///
/// </summary>
Error,
/// <summary>
///
/// </summary>
ContentFiltered,
Success,
}

/// <summary>
Expand All @@ -34,9 +34,9 @@ public static string ToValueString(this ImageFinishReason value)
{
return value switch
{
ImageFinishReason.Success => "SUCCESS",
ImageFinishReason.Error => "ERROR",
ImageFinishReason.ContentFiltered => "CONTENT_FILTERED",
ImageFinishReason.Error => "ERROR",
ImageFinishReason.Success => "SUCCESS",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -47,9 +47,9 @@ public static string ToValueString(this ImageFinishReason value)
{
return value switch
{
"SUCCESS" => ImageFinishReason.Success,
"ERROR" => ImageFinishReason.Error,
"CONTENT_FILTERED" => ImageFinishReason.ContentFiltered,
"ERROR" => ImageFinishReason.Error,
"SUCCESS" => ImageFinishReason.Success,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ namespace StabilityAI
TypeDiscriminatorPropertyName = "mask_source",
IgnoreUnrecognizedTypeDiscriminators = true,
UnknownDerivedTypeHandling = global::System.Text.Json.Serialization.JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
[global::System.Text.Json.Serialization.JsonDerivedType(typeof(StabilityAI.MaskingUsingInitImageAlphaRequestBody), typeDiscriminator: "INIT_IMAGE_ALPHA")]
[global::System.Text.Json.Serialization.JsonDerivedType(typeof(StabilityAI.MaskingUsingMaskImageRequestBody), typeDiscriminator: "MASK_IMAGE_BLACK")]
[global::System.Text.Json.Serialization.JsonDerivedType(typeof(StabilityAI.MaskingUsingMaskImageRequestBody), typeDiscriminator: "MASK_IMAGE_WHITE")]
[global::System.Text.Json.Serialization.JsonDerivedType(typeof(StabilityAI.MaskingUsingInitImageAlphaRequestBody), typeDiscriminator: "INIT_IMAGE_ALPHA")]
public partial class MaskingRequestBody
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public enum MaskingRequestBodyDiscriminatorMaskSource
/// <summary>
///
/// </summary>
MaskImageBlack,
InitImageAlpha,
/// <summary>
///
/// </summary>
MaskImageWhite,
MaskImageBlack,
/// <summary>
///
/// </summary>
InitImageAlpha,
MaskImageWhite,
}

/// <summary>
Expand All @@ -34,9 +34,9 @@ public static string ToValueString(this MaskingRequestBodyDiscriminatorMaskSourc
{
return value switch
{
MaskingRequestBodyDiscriminatorMaskSource.InitImageAlpha => "INIT_IMAGE_ALPHA",
MaskingRequestBodyDiscriminatorMaskSource.MaskImageBlack => "MASK_IMAGE_BLACK",
MaskingRequestBodyDiscriminatorMaskSource.MaskImageWhite => "MASK_IMAGE_WHITE",
MaskingRequestBodyDiscriminatorMaskSource.InitImageAlpha => "INIT_IMAGE_ALPHA",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -47,9 +47,9 @@ public static string ToValueString(this MaskingRequestBodyDiscriminatorMaskSourc
{
return value switch
{
"INIT_IMAGE_ALPHA" => MaskingRequestBodyDiscriminatorMaskSource.InitImageAlpha,
"MASK_IMAGE_BLACK" => MaskingRequestBodyDiscriminatorMaskSource.MaskImageBlack,
"MASK_IMAGE_WHITE" => MaskingRequestBodyDiscriminatorMaskSource.MaskImageWhite,
"INIT_IMAGE_ALPHA" => MaskingRequestBodyDiscriminatorMaskSource.InitImageAlpha,
_ => null,
};
}
Expand Down