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 @@ -137,6 +137,12 @@ partial void ProcessPostGenerateImageV3ResponseContent(
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceImages, x => x))}]"),
name: "style_reference_images");
}
if (request.CharacterReferenceImages != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceImages, x => x))}]"),
name: "character_reference_images");
}
__httpRequest.Content = __httpRequestContent;

Expand Down Expand Up @@ -420,6 +426,9 @@ partial void ProcessPostGenerateImageV3ResponseContent(
/// <param name="styleReferenceImages">
/// A set of images to use as style references (maximum total size 10MB across all style references). The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references (maximum total size 10MB across all character references). The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::Ideogram.ImageGenerationResponseV3> PostGenerateImageV3Async(
Expand All @@ -435,6 +444,7 @@ partial void ProcessPostGenerateImageV3ResponseContent(
global::System.Collections.Generic.IList<string>? styleCodes = default,
global::Ideogram.StyleTypeV3? styleType = default,
global::System.Collections.Generic.IList<byte[]>? styleReferenceImages = default,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Ideogram.GenerateImageRequestV3
Expand All @@ -451,6 +461,7 @@ partial void ProcessPostGenerateImageV3ResponseContent(
StyleCodes = styleCodes,
StyleType = styleType,
StyleReferenceImages = styleReferenceImages,
CharacterReferenceImages = characterReferenceImages,
};

return await PostGenerateImageV3Async(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public partial interface IGenerateClient
/// <param name="styleReferenceImages">
/// A set of images to use as style references (maximum total size 10MB across all style references). The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references (maximum total size 10MB across all character references). The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Ideogram.ImageGenerationResponseV3> PostGenerateImageV3Async(
Expand All @@ -83,6 +86,7 @@ public partial interface IGenerateClient
global::System.Collections.Generic.IList<string>? styleCodes = default,
global::Ideogram.StyleTypeV3? styleType = default,
global::System.Collections.Generic.IList<byte[]>? styleReferenceImages = default,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public partial interface IPromptClient
/// Random seed for reproducible generation<br/>
/// Example: 12345
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references. The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="systemPrompt">
/// A system prompt to use for the magic prompt.<br/>
/// Example: You are a helpful assistant that generates magic prompts for images.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Ideogram.MagicPromptResponse> PostMagicPromptAsync(
Expand All @@ -49,6 +56,8 @@ public partial interface IPromptClient
bool classifyPromptCategory,
global::Ideogram.StyleTypeV3? styleType = default,
int? seed = default,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages = default,
string? systemPrompt = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public sealed partial class GenerateImageRequestV3
[global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")]
public global::System.Collections.Generic.IList<byte[]>? StyleReferenceImages { get; set; }

/// <summary>
/// A set of images to use as character references (maximum total size 10MB across all character references). The images should be in JPEG, PNG or WebP format.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")]
public global::System.Collections.Generic.IList<byte[]>? CharacterReferenceImages { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand Down Expand Up @@ -161,6 +167,9 @@ public sealed partial class GenerateImageRequestV3
/// <param name="styleReferenceImages">
/// A set of images to use as style references (maximum total size 10MB across all style references). The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references (maximum total size 10MB across all character references). The images should be in JPEG, PNG or WebP format.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -176,7 +185,8 @@ public GenerateImageRequestV3(
global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette,
global::System.Collections.Generic.IList<string>? styleCodes,
global::Ideogram.StyleTypeV3? styleType,
global::System.Collections.Generic.IList<byte[]>? styleReferenceImages)
global::System.Collections.Generic.IList<byte[]>? styleReferenceImages,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages)
{
this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt));
this.Seed = seed;
Expand All @@ -190,6 +200,7 @@ public GenerateImageRequestV3(
this.StyleCodes = styleCodes;
this.StyleType = styleType;
this.StyleReferenceImages = styleReferenceImages;
this.CharacterReferenceImages = characterReferenceImages;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ public sealed partial class MagicPromptRequest
[global::System.Text.Json.Serialization.JsonPropertyName("seed")]
public int? Seed { get; set; }

/// <summary>
/// A set of images to use as character references. The images should be in JPEG, PNG or WebP format.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")]
public global::System.Collections.Generic.IList<byte[]>? CharacterReferenceImages { get; set; }

/// <summary>
/// A system prompt to use for the magic prompt.<br/>
/// Example: You are a helpful assistant that generates magic prompts for images.
/// </summary>
/// <example>You are a helpful assistant that generates magic prompts for images.</example>
[global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")]
public string? SystemPrompt { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand Down Expand Up @@ -87,6 +101,13 @@ public sealed partial class MagicPromptRequest
/// Random seed for reproducible generation<br/>
/// Example: 12345
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references. The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="systemPrompt">
/// A system prompt to use for the magic prompt.<br/>
/// Example: You are a helpful assistant that generates magic prompts for images.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -95,13 +116,17 @@ public MagicPromptRequest(
global::Ideogram.MagicPromptVersionEnum magicPromptVersion,
bool classifyPromptCategory,
global::Ideogram.StyleTypeV3? styleType,
int? seed)
int? seed,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages,
string? systemPrompt)
{
this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt));
this.MagicPromptVersion = magicPromptVersion;
this.ClassifyPromptCategory = classifyPromptCategory;
this.StyleType = styleType;
this.Seed = seed;
this.CharacterReferenceImages = characterReferenceImages;
this.SystemPrompt = systemPrompt;
}

/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public enum StyleType
/// <summary>
///
/// </summary>
FICTION,
/// <summary>
///
/// </summary>
REALISTIC,
/// <summary>
///
Expand Down Expand Up @@ -53,6 +57,7 @@ public static string ToValueString(this StyleType value)
{
StyleType.AUTO => "AUTO",
StyleType.GENERAL => "GENERAL",
StyleType.FICTION => "FICTION",
StyleType.REALISTIC => "REALISTIC",
StyleType.DESIGN => "DESIGN",
StyleType.RENDER3D => "RENDER_3D",
Expand All @@ -70,6 +75,7 @@ public static string ToValueString(this StyleType value)
{
"AUTO" => StyleType.AUTO,
"GENERAL" => StyleType.GENERAL,
"FICTION" => StyleType.FICTION,
"REALISTIC" => StyleType.REALISTIC,
"DESIGN" => StyleType.DESIGN,
"RENDER_3D" => StyleType.RENDER3D,
Expand Down
6 changes: 6 additions & 0 deletions src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public enum StyleTypeV3
///
/// </summary>
CUSTOM,
/// <summary>
///
/// </summary>
FICTION,
}

/// <summary>
Expand All @@ -49,6 +53,7 @@ public static string ToValueString(this StyleTypeV3 value)
StyleTypeV3.REALISTIC => "REALISTIC",
StyleTypeV3.DESIGN => "DESIGN",
StyleTypeV3.CUSTOM => "CUSTOM",
StyleTypeV3.FICTION => "FICTION",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -64,6 +69,7 @@ public static string ToValueString(this StyleTypeV3 value)
"REALISTIC" => StyleTypeV3.REALISTIC,
"DESIGN" => StyleTypeV3.DESIGN,
"CUSTOM" => StyleTypeV3.CUSTOM,
"FICTION" => StyleTypeV3.FICTION,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,40 @@ partial void ProcessPostMagicPromptResponseContent(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
name: "prompt");
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.MagicPromptVersion.ToValueString()}"),
name: "magic_prompt_version");
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ClassifyPromptCategory}"),
name: "classify_prompt_category");
if (request.StyleType != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.StyleType?.ToValueString()}"),
name: "style_type");
}
if (request.Seed != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Seed}"),
name: "seed");
}
if (request.CharacterReferenceImages != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceImages, x => x))}]"),
name: "character_reference_images");
}
if (request.SystemPrompt != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.SystemPrompt}"),
name: "system_prompt");
}
__httpRequest.Content = __httpRequestContent;

PrepareRequest(
Expand Down Expand Up @@ -324,6 +353,13 @@ partial void ProcessPostMagicPromptResponseContent(
/// Random seed for reproducible generation<br/>
/// Example: 12345
/// </param>
/// <param name="characterReferenceImages">
/// A set of images to use as character references. The images should be in JPEG, PNG or WebP format.
/// </param>
/// <param name="systemPrompt">
/// A system prompt to use for the magic prompt.<br/>
/// Example: You are a helpful assistant that generates magic prompts for images.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::Ideogram.MagicPromptResponse> PostMagicPromptAsync(
Expand All @@ -332,6 +368,8 @@ partial void ProcessPostMagicPromptResponseContent(
bool classifyPromptCategory,
global::Ideogram.StyleTypeV3? styleType = default,
int? seed = default,
global::System.Collections.Generic.IList<byte[]>? characterReferenceImages = default,
string? systemPrompt = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Ideogram.MagicPromptRequest
Expand All @@ -341,6 +379,8 @@ partial void ProcessPostMagicPromptResponseContent(
ClassifyPromptCategory = classifyPromptCategory,
StyleType = styleType,
Seed = seed,
CharacterReferenceImages = characterReferenceImages,
SystemPrompt = systemPrompt,
};

return await PostMagicPromptAsync(
Expand Down
23 changes: 22 additions & 1 deletion src/libs/Ideogram/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,14 @@ paths:
requestBody:
description: A request to generate a magic prompt
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/MagicPromptRequest'
application/json:
schema:
$ref: '#/components/schemas/MagicPromptRequest'
required: true
x-body-name: magic_prompt_request
x-body-name: body
responses:
'200':
description: Magic prompt generated successfully.
Expand Down Expand Up @@ -1012,6 +1015,12 @@ components:
type: string
format: binary
description: 'A set of images to use as style references (maximum total size 10MB across all style references). The images should be in JPEG, PNG or WebP format.'
character_reference_images:
type: array
items:
type: string
format: binary
description: 'A set of images to use as character references (maximum total size 10MB across all character references). The images should be in JPEG, PNG or WebP format.'
RemixImageRequestV3:
required:
- image
Expand Down Expand Up @@ -1608,6 +1617,16 @@ components:
type: integer
description: Random seed for reproducible generation
example: 12345
character_reference_images:
type: array
items:
type: string
format: binary
description: 'A set of images to use as character references. The images should be in JPEG, PNG or WebP format.'
system_prompt:
type: string
description: A system prompt to use for the magic prompt.
example: You are a helpful assistant that generates magic prompts for images.
description: A request to generate a magic prompt
example:
prompt: a cat
Expand Down Expand Up @@ -2019,6 +2038,7 @@ components:
enum:
- AUTO
- GENERAL
- FICTION
- REALISTIC
- DESIGN
- RENDER_3D
Expand Down Expand Up @@ -2258,6 +2278,7 @@ components:
- REALISTIC
- DESIGN
- CUSTOM
- FICTION
type: string
description: The style type to generate with.
default: GENERAL
Expand Down
Loading