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 @@ -39,14 +39,20 @@ namespace Ideogram
typeof(global::Ideogram.JsonConverters.StyleTypeV3NullableJsonConverter),
typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter),
typeof(global::Ideogram.JsonConverters.StylePresetV3NullableJsonConverter),
typeof(global::Ideogram.JsonConverters.UpscaleFactorJsonConverter),
typeof(global::Ideogram.JsonConverters.UpscaleFactorNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.InternalTestingEnumFieldJsonConverter),
typeof(global::Ideogram.JsonConverters.InternalTestingEnumFieldNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.TextLayerV3AlignmentJsonConverter),
typeof(global::Ideogram.JsonConverters.TextLayerV3AlignmentNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.ToolTypeJsonConverter),
typeof(global::Ideogram.JsonConverters.ToolTypeNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.ModelVersionJsonConverter),
typeof(global::Ideogram.JsonConverters.ModelVersionNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.SegmentByJsonConverter),
typeof(global::Ideogram.JsonConverters.SegmentByNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.UsageSourceJsonConverter),
typeof(global::Ideogram.JsonConverters.UsageSourceNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.ApiProfileTypeJsonConverter),
typeof(global::Ideogram.JsonConverters.ApiProfileTypeNullableJsonConverter),
typeof(global::Ideogram.JsonConverters.ApiProfileRoleJsonConverter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ partial void ProcessPostBatchResponseContent(
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Ideogram.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Ideogram.InternalBatchResponse> PostBatchAsync(

global::Ideogram.InternalBatchRequest request,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -312,7 +313,9 @@ partial void ProcessPostBatchResponseContent(
/// The experiment variant used for template selection for the magic prompts.<br/>
/// Example: MAGIC_PROMPT_NO_TEXT
/// </param>
/// <param name="samplingRequestParams"></param>
/// <param name="samplingRequestParams">
/// Example: {"aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}}
/// </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.InternalBatchResponse> PostBatchAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ partial void ProcessPostEditImageResponseContent(
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Ideogram.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Ideogram.GenerateImageResponse> PostEditImageAsync(

global::Ideogram.EditImageRequest request,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -71,43 +72,57 @@ partial void ProcessPostEditImageResponseContent(
}
}
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty<byte>());
__httpRequestContent.Add(
content: new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty<byte>()),
name: "image_file",
fileName: request.ImageFilename ?? string.Empty);
content: __contentImageFile,
name: "\"image_file\"",
fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty);
if (__contentImageFile.Headers.ContentDisposition != null)
{
__contentImageFile.Headers.ContentDisposition.FileNameStar = null;
}
var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty<byte>());
__httpRequestContent.Add(
content: new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty<byte>()),
name: "mask",
fileName: request.Maskname ?? string.Empty);
content: __contentMask,
name: "\"mask\"",
fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty);
if (__contentMask.Headers.ContentDisposition != null)
{
__contentMask.Headers.ContentDisposition.FileNameStar = null;
}
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
name: "prompt");
name: "\"prompt\"");
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Model.ToValueString()}"),
name: "model");
name: "\"model\"");
if (request.MagicPromptOption != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.MagicPromptOption?.ToValueString()}"),
name: "magic_prompt_option");
name: "\"magic_prompt_option\"");
}
if (request.NumImages != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.NumImages}"),
name: "num_images");
name: "\"num_images\"");
}
if (request.Seed != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Seed}"),
name: "seed");
name: "\"seed\"");
}
if (request.StyleType != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.StyleType?.ToValueString()}"),
name: "style_type");
name: "\"style_type\"");
}
__httpRequest.Content = __httpRequestContent;

Expand Down Expand Up @@ -391,7 +406,7 @@ partial void ProcessPostEditImageResponseContent(
byte[] mask,
string maskname,
string prompt,
global::Ideogram.ModelEnum model,
global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2,
global::Ideogram.MagicPromptOption? magicPromptOption = default,
int? numImages = default,
int? seed = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ partial void ProcessPostEditImageV3ResponseContent(
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Ideogram.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Ideogram.ImageGenerationResponseV3> PostEditImageV3Async(

global::Ideogram.EditImageRequestV3 request,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -71,82 +72,110 @@ partial void ProcessPostEditImageV3ResponseContent(
}
}
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>());
__httpRequestContent.Add(
content: new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>()),
name: "image",
fileName: request.Imagename ?? string.Empty);
content: __contentImage,
name: "\"image\"",
fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty);
if (__contentImage.Headers.ContentDisposition != null)
{
__contentImage.Headers.ContentDisposition.FileNameStar = null;
}
var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty<byte>());
__httpRequestContent.Add(
content: new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty<byte>()),
name: "mask",
fileName: request.Maskname ?? string.Empty);
content: __contentMask,
name: "\"mask\"",
fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty);
if (__contentMask.Headers.ContentDisposition != null)
{
__contentMask.Headers.ContentDisposition.FileNameStar = null;
}
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
name: "prompt");
name: "\"prompt\"");
if (request.MagicPrompt != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.MagicPrompt?.ToValueString()}"),
name: "magic_prompt");
name: "\"magic_prompt\"");
}
if (request.NumImages != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.NumImages}"),
name: "num_images");
name: "\"num_images\"");
}
if (request.Seed != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Seed}"),
name: "seed");
name: "\"seed\"");
}
if (request.RenderingSpeed != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.RenderingSpeed?.ToValueString()}"),
name: "rendering_speed");
name: "\"rendering_speed\"");
}
if (request.StyleType != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.StyleType?.ToValueString()}"),
name: "style_type");
name: "\"style_type\"");
}
if (request.StylePreset != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.StylePreset?.ToValueString()}"),
name: "style_preset");
name: "\"style_preset\"");
}
if (request.CustomModelUri != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.CustomModelUri}"),
name: "\"custom_model_uri\"");
}
if (request.ColorPalette != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.ColorPalette?.ToString() ?? string.Empty),
name: "color_palette");
name: "\"color_palette\"");
}
if (request.StyleCodes != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes, x => x))}]"),
name: "style_codes");
name: "\"style_codes\"");
}
if (request.StyleReferenceImages != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceImages, x => x))}]"),
name: "style_reference_images");
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");
name: "\"character_reference_images\"");
}
if (request.CharacterReferenceImagesMask != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceImagesMask, x => x))}]"),
name: "character_reference_images_mask");
name: "\"character_reference_images_mask\"");
}
__httpRequest.Content = __httpRequestContent;

Expand Down Expand Up @@ -426,6 +455,11 @@ partial void ProcessPostEditImageV3ResponseContent(
/// A predefined style preset that applies a specific artistic style to the generated image.<br/>
/// Example: BRIGHT_ART
/// </param>
/// <param name="customModelUri">
/// A custom model URI in the format model/&lt;model_name&gt;/version/&lt;version_name&gt;. <br/>
/// When provided, the model version and style will be resolved from this URI, and style_type is not required.<br/>
/// Example: model/my-custom-model/version/1
/// </param>
/// <param name="colorPalette">
/// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models.
/// </param>
Expand Down Expand Up @@ -456,6 +490,7 @@ partial void ProcessPostEditImageV3ResponseContent(
global::Ideogram.RenderingSpeed? renderingSpeed = default,
global::Ideogram.StyleTypeV3? styleType = default,
global::Ideogram.StylePresetV3? stylePreset = default,
string? customModelUri = default,
global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default,
global::System.Collections.Generic.IList<string>? styleCodes = default,
global::System.Collections.Generic.IList<byte[]>? styleReferenceImages = default,
Expand All @@ -476,6 +511,7 @@ partial void ProcessPostEditImageV3ResponseContent(
RenderingSpeed = renderingSpeed,
StyleType = styleType,
StylePreset = stylePreset,
CustomModelUri = customModelUri,
ColorPalette = colorPalette,
StyleCodes = styleCodes,
StyleReferenceImages = styleReferenceImages,
Expand Down
Loading
Loading