JimengSDK 1.0.2
dotnet add package JimengSDK --version 1.0.2
NuGet\Install-Package JimengSDK -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JimengSDK" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JimengSDK" Version="1.0.2" />
<PackageReference Include="JimengSDK" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JimengSDK --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JimengSDK, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JimengSDK@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JimengSDK&version=1.0.2
#tool nuget:?package=JimengSDK&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
即梦AI的C#版SDK
已实现接口
- 图生图3.0
使用示例
配置密钥
{
"JimengAI": {
"AccessKeyId": "AKxxx",
"AccessKeySecret": "xxxx"
}
}
注册即梦API客户端
services.AddJiMengAIClient();
创建图生图任务
public class DemoService(IJimengClientFactory clientFactory)
{
public async Task RunAsync()
{
var client = clientFactory.CreateClient();
var prompt = "把图片中所有人消除, 把红色裙子改成淡蓝色,把天气环境改为下雪天";
ICollection<string> images =
["https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_6dc837655edb35b90071547bc0b96e9e.png"];
// 创建图生图任务
var res1 = await client.ImageToImageV3Async(prompt, null, images);
// 或者用扩展方法直接调用
var res = await _client.ImageToImageV3FromUrlAsync(prompt, url);
Console.WriteLine($"taskId = {res1.Data.TaskId}");
var res2 = await client.GetImageToImageV3ResultAsync(res1.Data.TaskId, true);
Console.WriteLine($"is done = {res2.Data.IsDone}");
if (res2.Data.IsDone && res2.Data.ImageUrls.Any())
{
Console.WriteLine($"image url: {res2.Data.ImageUrls.First()}");
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.Extensions.Http (>= 9.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.