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 @@ -91,6 +91,12 @@ partial void ProcessPostEditImageResponseContent(
content: new global::System.Net.Http.StringContent($"{request.MagicPromptOption?.ToValueString()}"),
name: "magic_prompt_option");
}
if (request.NumImages != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.NumImages}"),
name: "num_images");
}
if (request.Seed != default)
{
__httpRequestContent.Add(
Expand Down Expand Up @@ -313,14 +319,17 @@ partial void ProcessPostEditImageResponseContent(
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.
/// </param>
/// <param name="model">
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </param>
/// <param name="magicPromptOption">
/// Determine if MagicPrompt should be used in generating the request or not<br/>
/// Example: ON
/// </param>
/// <param name="numImages">
/// Default Value: 1
/// </param>
/// <param name="seed">
/// Example: 12345
/// </param>
Expand All @@ -338,6 +347,7 @@ partial void ProcessPostEditImageResponseContent(
string prompt,
global::Ideogram.ModelEnum model,
global::Ideogram.MagicPromptOption? magicPromptOption = default,
int? numImages = default,
int? seed = default,
global::Ideogram.StyleType? styleType = default,
global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -351,6 +361,7 @@ partial void ProcessPostEditImageResponseContent(
Prompt = prompt,
Model = model,
MagicPromptOption = magicPromptOption,
NumImages = numImages,
Seed = seed,
StyleType = styleType,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ public partial interface IGenerateClient
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.
/// </param>
/// <param name="model">
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </param>
/// <param name="magicPromptOption">
/// Determine if MagicPrompt should be used in generating the request or not<br/>
/// Example: ON
/// </param>
/// <param name="numImages">
/// Default Value: 1
/// </param>
/// <param name="seed">
/// Example: 12345
/// </param>
Expand All @@ -67,6 +70,7 @@ public partial interface IGenerateClient
string prompt,
global::Ideogram.ModelEnum model,
global::Ideogram.MagicPromptOption? magicPromptOption = default,
int? numImages = default,
int? seed = default,
global::Ideogram.StyleType? styleType = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
15 changes: 13 additions & 2 deletions src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed partial class EditImageRequest
public required string Prompt { get; set; }

/// <summary>
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </summary>
Expand All @@ -66,6 +66,12 @@ public sealed partial class EditImageRequest
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))]
public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; }

/// <summary>
/// Default Value: 1
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("num_images")]
public int? NumImages { get; set; }

/// <summary>
/// Example: 12345
/// </summary>
Expand Down Expand Up @@ -108,14 +114,17 @@ public sealed partial class EditImageRequest
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.
/// </param>
/// <param name="model">
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </param>
/// <param name="magicPromptOption">
/// Determine if MagicPrompt should be used in generating the request or not<br/>
/// Example: ON
/// </param>
/// <param name="numImages">
/// Default Value: 1
/// </param>
/// <param name="seed">
/// Example: 12345
/// </param>
Expand All @@ -132,6 +141,7 @@ public EditImageRequest(
string prompt,
global::Ideogram.ModelEnum model,
global::Ideogram.MagicPromptOption? magicPromptOption,
int? numImages,
int? seed,
global::Ideogram.StyleType? styleType)
{
Expand All @@ -142,6 +152,7 @@ public EditImageRequest(
this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt));
this.Model = model;
this.MagicPromptOption = magicPromptOption;
this.NumImages = numImages;
this.Seed = seed;
this.StyleType = styleType;
}
Expand Down
15 changes: 13 additions & 2 deletions src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed partial class ImageRequest
public global::Ideogram.AspectRatio? AspectRatio { get; set; }

/// <summary>
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </summary>
Expand Down Expand Up @@ -69,6 +69,12 @@ public sealed partial class ImageRequest
[global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")]
public string? NegativePrompt { get; set; }

/// <summary>
/// Default Value: 1
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("num_images")]
public int? NumImages { get; set; }

/// <summary>
/// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.<br/>
/// Example: RESOLUTION_1024_1024
Expand Down Expand Up @@ -103,7 +109,7 @@ public sealed partial class ImageRequest
/// Example: ASPECT_10_16
/// </param>
/// <param name="model">
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </param>
Expand All @@ -122,6 +128,9 @@ public sealed partial class ImageRequest
/// Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.<br/>
/// Example: brush strokes, painting
/// </param>
/// <param name="numImages">
/// Default Value: 1
/// </param>
/// <param name="resolution">
/// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.<br/>
/// Example: RESOLUTION_1024_1024
Expand All @@ -138,6 +147,7 @@ public ImageRequest(
int? seed,
global::Ideogram.StyleType? styleType,
string? negativePrompt,
int? numImages,
global::Ideogram.Resolution? resolution,
global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette)
{
Expand All @@ -148,6 +158,7 @@ public ImageRequest(
this.Seed = seed;
this.StyleType = styleType;
this.NegativePrompt = negativePrompt;
this.NumImages = numImages;
this.Resolution = resolution;
this.ColorPalette = colorPalette;
}
Expand Down
14 changes: 13 additions & 1 deletion src/libs/Ideogram/Generated/Ideogram.Models.ModelEnum.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Ideogram
{
/// <summary>
/// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.<br/>
/// Default Value: V_2<br/>
/// Example: V_2_TURBO
/// </summary>
Expand All @@ -26,6 +26,14 @@ public enum ModelEnum
///
/// </summary>
V2TURBO,
/// <summary>
///
/// </summary>
V21,
/// <summary>
///
/// </summary>
V21TURBO,
}

/// <summary>
Expand All @@ -44,6 +52,8 @@ public static string ToValueString(this ModelEnum value)
ModelEnum.V1TURBO => "V_1_TURBO",
ModelEnum.V2 => "V_2",
ModelEnum.V2TURBO => "V_2_TURBO",
ModelEnum.V21 => "V_2_1",
ModelEnum.V21TURBO => "V_2_1_TURBO",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -58,6 +68,8 @@ public static string ToValueString(this ModelEnum value)
"V_1_TURBO" => ModelEnum.V1TURBO,
"V_2" => ModelEnum.V2,
"V_2_TURBO" => ModelEnum.V2TURBO,
"V_2_1" => ModelEnum.V21,
"V_2_1_TURBO" => ModelEnum.V21TURBO,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public sealed partial class UpscaleInitialImageRequest
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))]
public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; }

/// <summary>
/// Default Value: 1
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("num_images")]
public int? NumImages { get; set; }

/// <summary>
/// Example: 12345
/// </summary>
Expand Down Expand Up @@ -73,6 +79,9 @@ public sealed partial class UpscaleInitialImageRequest
/// Determine if MagicPrompt should be used in generating the request or not<br/>
/// Example: ON
/// </param>
/// <param name="numImages">
/// Default Value: 1
/// </param>
/// <param name="seed">
/// Example: 12345
/// </param>
Expand All @@ -82,12 +91,14 @@ public UpscaleInitialImageRequest(
int? resemblance,
int? detail,
global::Ideogram.MagicPromptOption? magicPromptOption,
int? numImages,
int? seed)
{
this.Prompt = prompt;
this.Resemblance = resemblance;
this.Detail = detail;
this.MagicPromptOption = magicPromptOption;
this.NumImages = numImages;
this.Seed = seed;
}

Expand Down
24 changes: 23 additions & 1 deletion src/libs/Ideogram/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ components:
$ref: '#/components/schemas/ModelEnum'
magic_prompt_option:
$ref: '#/components/schemas/MagicPromptOption'
num_images:
$ref: '#/components/schemas/NumImages'
seed:
$ref: '#/components/schemas/Seed'
style_type:
Expand Down Expand Up @@ -646,6 +648,12 @@ components:
type: string
description: Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
example: 'brush strokes, painting'
num_images:
title: num_images
maximum: 8
minimum: 1
type: integer
default: 1
Comment on lines +651 to +656
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using schema reference for num_images property.

The num_images property is defined inline with the same constraints as the NumImages schema. To improve maintainability and ensure consistency, consider using a schema reference instead.

Apply this change:

        num_images:
-          title: num_images
-          maximum: 8
-          minimum: 1
-          type: integer
-          default: 1
+          $ref: '#/components/schemas/NumImages'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
num_images:
title: num_images
maximum: 8
minimum: 1
type: integer
default: 1
num_images:
$ref: '#/components/schemas/NumImages'

resolution:
$ref: '#/components/schemas/Resolution'
color_palette:
Expand Down Expand Up @@ -699,6 +707,12 @@ components:
example: 50
magic_prompt_option:
$ref: '#/components/schemas/MagicPromptOption'
num_images:
title: num_images
maximum: 8
minimum: 1
type: integer
default: 1
Comment on lines +710 to +715
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using schema reference for num_images property.

The num_images property is defined inline with the same constraints as the NumImages schema. To improve maintainability and ensure consistency, consider using a schema reference instead.

Apply this change:

        num_images:
-          title: num_images
-          maximum: 8
-          minimum: 1
-          type: integer
-          default: 1
+          $ref: '#/components/schemas/NumImages'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
num_images:
title: num_images
maximum: 8
minimum: 1
type: integer
default: 1
num_images:
$ref: '#/components/schemas/NumImages'

seed:
title: Seed
maximum: 2147483647
Expand Down Expand Up @@ -792,8 +806,10 @@ components:
- V_1_TURBO
- V_2
- V_2_TURBO
- V_2_1
- V_2_1_TURBO
type: string
description: 'The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.'
description: 'The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.'
Comment on lines +809 to +812
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Inconsistency found in model compatibility documentation

The ModelEnum description states that "/edit is only supported for V_2 and V_2_TURBO", but this appears to be outdated since the ModelEnum now includes V_2_1 and V_2_1_TURBO. The endpoint documentation doesn't explicitly specify model restrictions for any endpoint, making it unclear whether the compatibility statement is accurate.

  • Update needed in ModelEnum description at line 812 to either:
    • Include V_2_1 and V_2_1_TURBO as supported models for /edit endpoint, or
    • Explicitly confirm that /edit endpoint is indeed restricted to only V_2 and V_2_TURBO
🔗 Analysis chain

LGTM: Model enum updates with clear compatibility documentation.

The addition of V_2_1 and V_2_1_TURBO models and the updated description clearly documenting endpoint compatibility is well implemented.

Let's verify the model compatibility documentation in the API endpoints:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify model compatibility documentation in endpoints

# Check if the model compatibility is consistently documented across endpoints
rg -A 5 "model:" openapi.yaml

Length of output: 82


Script:

#!/bin/bash
# First, let's find the correct path to the openapi.yaml file
fd openapi.yaml

# Then, let's check the model compatibility documentation across endpoints
rg -A 5 "model:" $(fd openapi.yaml)

Length of output: 2619


Script:

#!/bin/bash
# Let's check the endpoint definitions to verify the model compatibility claims
rg -B 5 -A 10 "/generate|/remix|/edit" src/libs/Ideogram/openapi.yaml

Length of output: 3008

default: V_2
example: V_2_TURBO
GenerateImageSafetyError:
Expand Down Expand Up @@ -1121,6 +1137,12 @@ components:
externalDocs:
url: https://docs.ideogram.ai/using-ideogram/ideogram-features/magic-prompt
example: ON
NumImages:
title: num_images
maximum: 8
minimum: 1
type: integer
default: 1
Comment on lines +1140 to +1145
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Inconsistent usage of NumImages schema found

The verification reveals inconsistency in the OpenAPI specification:

  • One occurrence properly references the NumImages schema using $ref: '#/components/schemas/NumImages'
  • Two other occurrences duplicate the schema definition inline instead of using the reference

This should be unified to consistently use the reusable NumImages schema component to maintain better maintainability and prevent potential inconsistencies.

🔗 Analysis chain

LGTM: Well-defined NumImages schema.

The NumImages schema is well-defined with appropriate constraints. However, ensure it's consistently used across all request schemas that include the num_images property.

Let's verify the consistent usage of the NumImages schema:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent usage of NumImages schema

# Check for all occurrences of num_images in the spec
rg -A 3 "num_images:" openapi.yaml

# Check for all references to NumImages schema
rg -A 1 '\$ref: ''#/components/schemas/NumImages''' openapi.yaml

Length of output: 203


Script:

#!/bin/bash
# First, let's find the correct path to the OpenAPI spec file
fd -g "*openapi*.yaml" -g "*openapi*.yml"

# Once we find it, we'll verify the usage patterns

Length of output: 144


Script:

#!/bin/bash
# Let's try a different approach to find the OpenAPI spec file
fd openapi

# Also try searching in common API documentation locations
fd -t f . src/libs/Ideogram/

Length of output: 10641


Script:

#!/bin/bash
# Now that we found the correct path, let's check for NumImages usage
rg -A 3 "num_images:" src/libs/Ideogram/openapi.yaml

# Check for references to NumImages schema
rg -A 1 '\$ref: ''#/components/schemas/NumImages''' src/libs/Ideogram/openapi.yaml

Length of output: 446


Script:

#!/bin/bash
# Let's get more context around these num_images occurrences
rg -B 2 -A 5 "num_images:" src/libs/Ideogram/openapi.yaml

Length of output: 898

Seed:
title: Seed
maximum: 2147483647
Expand Down
Loading