Skip to content

Commit 3b3b65a

Browse files
committed
Format
1 parent 0ccdc16 commit 3b3b65a

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

autogpt_platform/backend/backend/blocks/ideogram.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,28 @@ async def run_model(
241241
# Use V3 endpoint for V3 model, legacy endpoint for others
242242
if model_name == "V_3":
243243
return await self._run_model_v3(
244-
api_key, prompt, seed, aspect_ratio, magic_prompt_option,
245-
style_type, negative_prompt, color_palette_name, custom_colors
244+
api_key,
245+
prompt,
246+
seed,
247+
aspect_ratio,
248+
magic_prompt_option,
249+
style_type,
250+
negative_prompt,
251+
color_palette_name,
252+
custom_colors,
246253
)
247254
else:
248255
return await self._run_model_legacy(
249-
api_key, model_name, prompt, seed, aspect_ratio, magic_prompt_option,
250-
style_type, negative_prompt, color_palette_name, custom_colors
256+
api_key,
257+
model_name,
258+
prompt,
259+
seed,
260+
aspect_ratio,
261+
magic_prompt_option,
262+
style_type,
263+
negative_prompt,
264+
color_palette_name,
265+
custom_colors,
251266
)
252267

253268
async def _run_model_v3(
@@ -271,11 +286,11 @@ async def _run_model_v3(
271286
# Map legacy aspect ratio values to V3 format
272287
aspect_ratio_map = {
273288
"ASPECT_10_16": "10x16",
274-
"ASPECT_16_10": "16x10",
289+
"ASPECT_16_10": "16x10",
275290
"ASPECT_9_16": "9x16",
276291
"ASPECT_16_9": "16x9",
277292
"ASPECT_3_2": "3x2",
278-
"ASPECT_2_3": "2x3",
293+
"ASPECT_2_3": "2x3",
279294
"ASPECT_4_3": "4x3",
280295
"ASPECT_3_4": "3x4",
281296
"ASPECT_1_1": "1x1",
@@ -284,11 +299,13 @@ async def _run_model_v3(
284299
# Additional V3 supported ratios
285300
"ASPECT_1_2": "1x2",
286301
"ASPECT_2_1": "2x1",
287-
"ASPECT_4_5": "4x5",
302+
"ASPECT_4_5": "4x5",
288303
"ASPECT_5_4": "5x4",
289304
}
290-
291-
v3_aspect_ratio = aspect_ratio_map.get(aspect_ratio, "1x1") # Default to 1x1 if not found
305+
306+
v3_aspect_ratio = aspect_ratio_map.get(
307+
aspect_ratio, "1x1"
308+
) # Default to 1x1 if not found
292309

293310
# Use JSON for V3 endpoint (simpler than multipart/form-data)
294311
data: Dict[str, Any] = {
@@ -306,7 +323,7 @@ async def _run_model_v3(
306323

307324
# Note: V3 endpoint may have different color palette support
308325
# For now, we'll omit color palettes for V3 to avoid errors
309-
326+
310327
try:
311328
response = await Requests().post(url, headers=headers, json=data)
312329
return response.json()["data"][0]["url"]

autogpt_platform/backend/backend/data/block_cost_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@
316316
"id": ideogram_credentials.id,
317317
"provider": ideogram_credentials.provider,
318318
"type": ideogram_credentials.type,
319-
}
319+
},
320320
},
321-
)
321+
),
322322
],
323323
AIShortformVideoCreatorBlock: [
324324
BlockCost(

0 commit comments

Comments
 (0)