@@ -75,4 +75,57 @@ public static Task<DashScopeTask<ImageSynthesisOutput, ImageSynthesisUsage>> Get
7575 {
7676 return dashScopeClient . GetTaskAsync < ImageSynthesisOutput , ImageSynthesisUsage > ( taskId , cancellationToken ) ;
7777 }
78+
79+ /// <summary>
80+ /// Creates a wanx image generation task with given model and input.
81+ /// </summary>
82+ /// <param name="dashScopeClient">The <see cref="IDashScopeClient"/>.</param>
83+ /// <param name="model">The model to use.</param>
84+ /// <param name="input">The input for image to be generate from.</param>
85+ /// <param name="cancellationToken">The cancellation token to use.</param>
86+ /// <returns>The generated task.</returns>
87+ public static Task < DashScopeTaskOutput > CreateWanxImageGenerationTaskAsync (
88+ this IDashScopeClient dashScopeClient ,
89+ WanxStyleRepaintModel model ,
90+ ImageGenerationInput input ,
91+ CancellationToken cancellationToken = default )
92+ {
93+ return dashScopeClient . CreateWanxImageGenerationTaskAsync ( model . GetModelName ( ) , input , cancellationToken ) ;
94+ }
95+
96+ /// <summary>
97+ /// Creates a wanx image generation task with given model and input.
98+ /// </summary>
99+ /// <param name="dashScopeClient">The <see cref="IDashScopeClient"/>.</param>
100+ /// <param name="model">The model to use.</param>
101+ /// <param name="input">The input for image to be generate from.</param>
102+ /// <param name="cancellationToken">The cancellation token to use.</param>
103+ /// <returns>The generated task.</returns>
104+ public static async Task < DashScopeTaskOutput > CreateWanxImageGenerationTaskAsync (
105+ this IDashScopeClient dashScopeClient ,
106+ string model ,
107+ ImageGenerationInput input ,
108+ CancellationToken cancellationToken = default )
109+ {
110+ var response = await dashScopeClient . CreateImageGenerationTaskAsync (
111+ new ModelRequest < ImageGenerationInput > { Model = model , Input = input } ,
112+ cancellationToken ) ;
113+ return response . Output ;
114+ }
115+
116+ /// <summary>
117+ /// Get wanx image generation task detail.
118+ /// </summary>
119+ /// <param name="dashScopeClient">The <see cref="IDashScopeClient"/>.</param>
120+ /// <param name="taskId">The task id to query.</param>
121+ /// <param name="cancellationToken">The cancellation token to use.</param>
122+ /// <returns></returns>
123+ public static Task < DashScopeTask < ImageGenerationOutput , ImageGenerationUsage > >
124+ GetWanxImageGenerationTaskAsync (
125+ this IDashScopeClient dashScopeClient ,
126+ string taskId ,
127+ CancellationToken cancellationToken = default )
128+ {
129+ return dashScopeClient . GetTaskAsync < ImageGenerationOutput , ImageGenerationUsage > ( taskId , cancellationToken ) ;
130+ }
78131}
0 commit comments