@weirdfingers/baseboards 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +560 -469
- package/dist/index.js.map +1 -1
- package/package.json +2 -5
- package/templates/README.md +0 -122
- package/templates/api/.env.example +0 -65
- package/templates/api/ARTIFACT_RESOLUTION_GUIDE.md +0 -148
- package/templates/api/Dockerfile +0 -32
- package/templates/api/README.md +0 -264
- package/templates/api/alembic/env.py +0 -114
- package/templates/api/alembic/script.py.mako +0 -28
- package/templates/api/alembic/versions/20250101_000000_initial_schema.py +0 -506
- package/templates/api/alembic/versions/20251022_174729_remove_provider_name_from_generations.py +0 -75
- package/templates/api/alembic/versions/20251023_165852_switch_to_declarative_base_and_mapping.py +0 -467
- package/templates/api/alembic/versions/20251202_000000_add_artifact_lineage.py +0 -134
- package/templates/api/alembic/versions/2025925_62735_add_seed_data_for_default_tenant.py +0 -88
- package/templates/api/alembic.ini +0 -36
- package/templates/api/config/generators.yaml +0 -237
- package/templates/api/config/storage_config.yaml +0 -26
- package/templates/api/docs/ADDING_GENERATORS.md +0 -409
- package/templates/api/docs/GENERATORS_API.md +0 -502
- package/templates/api/docs/MIGRATIONS.md +0 -472
- package/templates/api/docs/TESTING_LIVE_APIS.md +0 -417
- package/templates/api/docs/storage_providers.md +0 -337
- package/templates/api/pyproject.toml +0 -205
- package/templates/api/src/boards/__init__.py +0 -10
- package/templates/api/src/boards/api/app.py +0 -172
- package/templates/api/src/boards/api/auth.py +0 -75
- package/templates/api/src/boards/api/endpoints/__init__.py +0 -3
- package/templates/api/src/boards/api/endpoints/jobs.py +0 -76
- package/templates/api/src/boards/api/endpoints/setup.py +0 -505
- package/templates/api/src/boards/api/endpoints/sse.py +0 -129
- package/templates/api/src/boards/api/endpoints/storage.py +0 -155
- package/templates/api/src/boards/api/endpoints/tenant_registration.py +0 -296
- package/templates/api/src/boards/api/endpoints/uploads.py +0 -149
- package/templates/api/src/boards/api/endpoints/webhooks.py +0 -13
- package/templates/api/src/boards/auth/__init__.py +0 -15
- package/templates/api/src/boards/auth/adapters/__init__.py +0 -27
- package/templates/api/src/boards/auth/adapters/auth0.py +0 -220
- package/templates/api/src/boards/auth/adapters/base.py +0 -73
- package/templates/api/src/boards/auth/adapters/clerk.py +0 -172
- package/templates/api/src/boards/auth/adapters/jwt.py +0 -122
- package/templates/api/src/boards/auth/adapters/none.py +0 -102
- package/templates/api/src/boards/auth/adapters/oidc.py +0 -284
- package/templates/api/src/boards/auth/adapters/supabase.py +0 -110
- package/templates/api/src/boards/auth/context.py +0 -35
- package/templates/api/src/boards/auth/factory.py +0 -129
- package/templates/api/src/boards/auth/middleware.py +0 -221
- package/templates/api/src/boards/auth/provisioning.py +0 -129
- package/templates/api/src/boards/auth/tenant_extraction.py +0 -278
- package/templates/api/src/boards/cli.py +0 -354
- package/templates/api/src/boards/config.py +0 -131
- package/templates/api/src/boards/database/__init__.py +0 -7
- package/templates/api/src/boards/database/cli.py +0 -110
- package/templates/api/src/boards/database/connection.py +0 -292
- package/templates/api/src/boards/database/models.py +0 -19
- package/templates/api/src/boards/database/seed_data.py +0 -182
- package/templates/api/src/boards/dbmodels/__init__.py +0 -441
- package/templates/api/src/boards/generators/__init__.py +0 -57
- package/templates/api/src/boards/generators/artifact_resolution.py +0 -405
- package/templates/api/src/boards/generators/artifacts.py +0 -53
- package/templates/api/src/boards/generators/base.py +0 -144
- package/templates/api/src/boards/generators/implementations/__init__.py +0 -14
- package/templates/api/src/boards/generators/implementations/fal/__init__.py +0 -25
- package/templates/api/src/boards/generators/implementations/fal/audio/__init__.py +0 -23
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_music_generation.py +0 -171
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_sound_effect_generation.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_text_to_speech.py +0 -176
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_tts_turbo.py +0 -195
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_sound_effects_v2.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_tts_eleven_v3.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_elevenlabs_tts_turbo_v2_5.py +0 -206
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_minimax_speech_26_hd.py +0 -237
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_music_v2.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_speech_2_6_turbo.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/__init__.py +0 -63
- package/templates/api/src/boards/generators/implementations/fal/image/bytedance_seedream_v45_edit.py +0 -219
- package/templates/api/src/boards/generators/implementations/fal/image/clarity_upscaler.py +0 -220
- package/templates/api/src/boards/generators/implementations/fal/image/crystal_upscaler.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/image/fal_ideogram_character.py +0 -227
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2.py +0 -203
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_edit.py +0 -230
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro.py +0 -204
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro_edit.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_kontext.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_ultra.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image_edit.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_15_edit.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_5.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_edit_image.py +0 -182
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_mini.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_character_edit.py +0 -299
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_v2.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview_fast.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_edit.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro_edit.py +0 -226
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image.py +0 -249
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image_edit.py +0 -244
- package/templates/api/src/boards/generators/implementations/fal/image/reve_edit.py +0 -178
- package/templates/api/src/boards/generators/implementations/fal/image/reve_text_to_image.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/image/seedream_v45_text_to_image.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/utils.py +0 -61
- package/templates/api/src/boards/generators/implementations/fal/video/__init__.py +0 -77
- package/templates/api/src/boards/generators/implementations/fal/video/bytedance_seedance_v1_pro_text_to_video.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/video/creatify_lipsync.py +0 -161
- package/templates/api/src/boards/generators/implementations/fal/video/fal_bytedance_seedance_v1_pro_image_to_video.py +0 -222
- package/templates/api/src/boards/generators/implementations/fal/video/fal_minimax_hailuo_02_standard_text_to_video.py +0 -152
- package/templates/api/src/boards/generators/implementations/fal/video/fal_pixverse_lipsync.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/video/fal_sora_2_text_to_video.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/video/infinitalk.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_pro.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_standard.py +0 -159
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_image_to_video.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_text_to_video.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/minimax_hailuo_2_3_pro_image_to_video.py +0 -153
- package/templates/api/src/boards/generators/implementations/fal/video/sora2_image_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_image_to_video_pro.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_text_to_video_pro.py +0 -163
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2_pro.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/video/veed_fabric_1_0.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/video/veed_lipsync.py +0 -174
- package/templates/api/src/boards/generators/implementations/fal/video/veo3.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/video/veo31.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast_image_to_video.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_first_last_frame_to_video.py +0 -187
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_image_to_video.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_reference_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_image_to_video.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_text_to_video.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/video/wan_pro_image_to_video.py +0 -158
- package/templates/api/src/boards/generators/implementations/kie/__init__.py +0 -11
- package/templates/api/src/boards/generators/implementations/kie/base.py +0 -316
- package/templates/api/src/boards/generators/implementations/kie/image/__init__.py +0 -3
- package/templates/api/src/boards/generators/implementations/kie/image/nano_banana_edit.py +0 -190
- package/templates/api/src/boards/generators/implementations/kie/utils.py +0 -98
- package/templates/api/src/boards/generators/implementations/kie/video/__init__.py +0 -8
- package/templates/api/src/boards/generators/implementations/kie/video/veo3.py +0 -161
- package/templates/api/src/boards/generators/implementations/openai/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/whisper.py +0 -69
- package/templates/api/src/boards/generators/implementations/openai/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/image/dalle3.py +0 -96
- package/templates/api/src/boards/generators/implementations/replicate/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/flux_pro.py +0 -88
- package/templates/api/src/boards/generators/implementations/replicate/video/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/video/lipsync.py +0 -73
- package/templates/api/src/boards/generators/loader.py +0 -253
- package/templates/api/src/boards/generators/registry.py +0 -114
- package/templates/api/src/boards/generators/resolution.py +0 -632
- package/templates/api/src/boards/generators/testmods/class_gen.py +0 -34
- package/templates/api/src/boards/generators/testmods/import_side_effect.py +0 -35
- package/templates/api/src/boards/graphql/__init__.py +0 -7
- package/templates/api/src/boards/graphql/access_control.py +0 -136
- package/templates/api/src/boards/graphql/mutations/root.py +0 -148
- package/templates/api/src/boards/graphql/queries/root.py +0 -116
- package/templates/api/src/boards/graphql/resolvers/__init__.py +0 -8
- package/templates/api/src/boards/graphql/resolvers/auth.py +0 -12
- package/templates/api/src/boards/graphql/resolvers/board.py +0 -1053
- package/templates/api/src/boards/graphql/resolvers/generation.py +0 -666
- package/templates/api/src/boards/graphql/resolvers/generator.py +0 -50
- package/templates/api/src/boards/graphql/resolvers/lineage.py +0 -381
- package/templates/api/src/boards/graphql/resolvers/upload.py +0 -463
- package/templates/api/src/boards/graphql/resolvers/user.py +0 -25
- package/templates/api/src/boards/graphql/schema.py +0 -81
- package/templates/api/src/boards/graphql/types/board.py +0 -102
- package/templates/api/src/boards/graphql/types/generation.py +0 -166
- package/templates/api/src/boards/graphql/types/generator.py +0 -17
- package/templates/api/src/boards/graphql/types/user.py +0 -47
- package/templates/api/src/boards/jobs/repository.py +0 -153
- package/templates/api/src/boards/logging.py +0 -195
- package/templates/api/src/boards/middleware.py +0 -339
- package/templates/api/src/boards/progress/__init__.py +0 -4
- package/templates/api/src/boards/progress/models.py +0 -25
- package/templates/api/src/boards/progress/publisher.py +0 -64
- package/templates/api/src/boards/py.typed +0 -0
- package/templates/api/src/boards/redis_pool.py +0 -118
- package/templates/api/src/boards/storage/__init__.py +0 -52
- package/templates/api/src/boards/storage/base.py +0 -363
- package/templates/api/src/boards/storage/config.py +0 -187
- package/templates/api/src/boards/storage/factory.py +0 -288
- package/templates/api/src/boards/storage/implementations/__init__.py +0 -27
- package/templates/api/src/boards/storage/implementations/gcs.py +0 -340
- package/templates/api/src/boards/storage/implementations/local.py +0 -201
- package/templates/api/src/boards/storage/implementations/s3.py +0 -294
- package/templates/api/src/boards/storage/implementations/supabase.py +0 -218
- package/templates/api/src/boards/tenant_isolation.py +0 -446
- package/templates/api/src/boards/validation.py +0 -262
- package/templates/api/src/boards/workers/__init__.py +0 -1
- package/templates/api/src/boards/workers/actors.py +0 -274
- package/templates/api/src/boards/workers/cli.py +0 -125
- package/templates/api/src/boards/workers/context.py +0 -348
- package/templates/api/src/boards/workers/middleware.py +0 -58
- package/templates/api/src/py.typed +0 -0
- package/templates/compose.web.yaml +0 -35
- package/templates/compose.yaml +0 -116
- package/templates/docker/env.example +0 -23
- package/templates/web/.env.example +0 -28
- package/templates/web/Dockerfile +0 -51
- package/templates/web/components.json +0 -22
- package/templates/web/imageLoader.js +0 -18
- package/templates/web/next-env.d.ts +0 -5
- package/templates/web/next.config.js +0 -36
- package/templates/web/package.json +0 -41
- package/templates/web/postcss.config.mjs +0 -7
- package/templates/web/public/favicon.ico +0 -0
- package/templates/web/src/app/boards/[boardId]/page.tsx +0 -353
- package/templates/web/src/app/globals.css +0 -123
- package/templates/web/src/app/layout.tsx +0 -31
- package/templates/web/src/app/lineage/[generationId]/page.tsx +0 -235
- package/templates/web/src/app/page.tsx +0 -35
- package/templates/web/src/app/providers.tsx +0 -18
- package/templates/web/src/components/boards/ArtifactInputSlots.tsx +0 -206
- package/templates/web/src/components/boards/ArtifactPreview.tsx +0 -466
- package/templates/web/src/components/boards/GenerationGrid.tsx +0 -282
- package/templates/web/src/components/boards/GenerationInput.tsx +0 -370
- package/templates/web/src/components/boards/GeneratorSelector.tsx +0 -272
- package/templates/web/src/components/boards/UploadArtifact.tsx +0 -563
- package/templates/web/src/components/header.tsx +0 -32
- package/templates/web/src/components/theme-provider.tsx +0 -10
- package/templates/web/src/components/theme-toggle.tsx +0 -75
- package/templates/web/src/components/ui/alert-dialog.tsx +0 -157
- package/templates/web/src/components/ui/button.tsx +0 -58
- package/templates/web/src/components/ui/card.tsx +0 -92
- package/templates/web/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/web/src/components/ui/navigation-menu.tsx +0 -168
- package/templates/web/src/components/ui/toast.tsx +0 -128
- package/templates/web/src/components/ui/toaster.tsx +0 -35
- package/templates/web/src/components/ui/use-toast.ts +0 -187
- package/templates/web/src/hooks/useGeneratorMRU.ts +0 -57
- package/templates/web/src/lib/utils.ts +0 -6
- package/templates/web/tsconfig.json +0 -41
package/templates/api/src/boards/generators/implementations/fal/audio/minimax_speech_2_6_turbo.py
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai MiniMax Speech 2.6 Turbo text-to-speech generator.
|
|
3
|
-
|
|
4
|
-
Generate speech from text prompts using the MiniMax Speech-2.6 HD model,
|
|
5
|
-
which leverages advanced AI techniques to create high-quality text-to-speech.
|
|
6
|
-
|
|
7
|
-
Based on Fal AI's fal-ai/minimax/speech-2.6-turbo model.
|
|
8
|
-
See: https://fal.ai/models/fal-ai/minimax/speech-2.6-turbo
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
import os
|
|
12
|
-
from typing import Literal
|
|
13
|
-
|
|
14
|
-
from pydantic import BaseModel, Field
|
|
15
|
-
|
|
16
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class VoiceSetting(BaseModel):
|
|
20
|
-
"""Voice configuration settings."""
|
|
21
|
-
|
|
22
|
-
voice_id: str = Field(
|
|
23
|
-
default="Wise_Woman",
|
|
24
|
-
description="Speaker identifier for the voice",
|
|
25
|
-
)
|
|
26
|
-
speed: float = Field(
|
|
27
|
-
default=1.0,
|
|
28
|
-
description="Playback speed multiplier",
|
|
29
|
-
)
|
|
30
|
-
pitch: float = Field(
|
|
31
|
-
default=0.0,
|
|
32
|
-
description="Pitch adjustment",
|
|
33
|
-
)
|
|
34
|
-
vol: float = Field(
|
|
35
|
-
default=1.0,
|
|
36
|
-
description="Volume level",
|
|
37
|
-
)
|
|
38
|
-
english_normalization: bool = Field(
|
|
39
|
-
default=False,
|
|
40
|
-
description="Enable English text normalization",
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class LoudnessNormalizationSetting(BaseModel):
|
|
45
|
-
"""Audio loudness normalization controls."""
|
|
46
|
-
|
|
47
|
-
enabled: bool = Field(
|
|
48
|
-
default=True,
|
|
49
|
-
description="Enable loudness normalization",
|
|
50
|
-
)
|
|
51
|
-
target_loudness: float = Field(
|
|
52
|
-
default=-18.0,
|
|
53
|
-
ge=-70.0,
|
|
54
|
-
le=-10.0,
|
|
55
|
-
description="Target loudness in LUFS",
|
|
56
|
-
)
|
|
57
|
-
target_range: float = Field(
|
|
58
|
-
default=8.0,
|
|
59
|
-
ge=0.0,
|
|
60
|
-
le=20.0,
|
|
61
|
-
description="Target range in LU",
|
|
62
|
-
)
|
|
63
|
-
target_peak: float = Field(
|
|
64
|
-
default=-0.5,
|
|
65
|
-
ge=-3.0,
|
|
66
|
-
le=0.0,
|
|
67
|
-
description="Target peak level in dBTP",
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class MinimaxSpeech26TurboInput(BaseModel):
|
|
72
|
-
"""Input schema for MiniMax Speech 2.6 Turbo generation."""
|
|
73
|
-
|
|
74
|
-
prompt: str = Field(
|
|
75
|
-
description=(
|
|
76
|
-
"Text to convert to speech (supports pause markers <#x#> with 0.01-99.99 seconds)"
|
|
77
|
-
),
|
|
78
|
-
min_length=1,
|
|
79
|
-
max_length=10000,
|
|
80
|
-
)
|
|
81
|
-
voice_setting: VoiceSetting = Field(
|
|
82
|
-
default_factory=VoiceSetting,
|
|
83
|
-
description="Voice configuration including voice_id, speed, pitch, volume",
|
|
84
|
-
)
|
|
85
|
-
language_boost: str = Field(
|
|
86
|
-
default="auto",
|
|
87
|
-
description=(
|
|
88
|
-
"Enhance recognition of specified languages and dialects "
|
|
89
|
-
"(auto or specific language code)"
|
|
90
|
-
),
|
|
91
|
-
)
|
|
92
|
-
output_format: Literal["url", "hex"] = Field(
|
|
93
|
-
default="url",
|
|
94
|
-
description="Output format: 'url' for audio file URL or 'hex' for hex-encoded data",
|
|
95
|
-
)
|
|
96
|
-
normalization_setting: LoudnessNormalizationSetting = Field(
|
|
97
|
-
default_factory=LoudnessNormalizationSetting,
|
|
98
|
-
description="Audio loudness normalization controls",
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class FalMinimaxSpeech26TurboGenerator(BaseGenerator):
|
|
103
|
-
"""MiniMax Speech 2.6 Turbo text-to-speech generator using fal.ai."""
|
|
104
|
-
|
|
105
|
-
name = "fal-minimax-speech-2-6-turbo"
|
|
106
|
-
artifact_type = "audio"
|
|
107
|
-
description = (
|
|
108
|
-
"Fal: MiniMax Speech 2.6 Turbo - "
|
|
109
|
-
"High-quality text-to-speech with customizable voices and 35+ languages"
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
def get_input_schema(self) -> type[MinimaxSpeech26TurboInput]:
|
|
113
|
-
return MinimaxSpeech26TurboInput
|
|
114
|
-
|
|
115
|
-
async def generate(
|
|
116
|
-
self, inputs: MinimaxSpeech26TurboInput, context: GeneratorExecutionContext
|
|
117
|
-
) -> GeneratorResult:
|
|
118
|
-
"""Generate audio using fal.ai MiniMax Speech 2.6 Turbo model."""
|
|
119
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
120
|
-
if not os.getenv("FAL_KEY"):
|
|
121
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
122
|
-
|
|
123
|
-
# Import fal_client
|
|
124
|
-
try:
|
|
125
|
-
import fal_client
|
|
126
|
-
except ImportError as e:
|
|
127
|
-
raise ImportError(
|
|
128
|
-
"fal.ai SDK is required for FalMinimaxSpeech26TurboGenerator. "
|
|
129
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
130
|
-
) from e
|
|
131
|
-
|
|
132
|
-
# Prepare arguments for fal.ai API
|
|
133
|
-
arguments = {
|
|
134
|
-
"prompt": inputs.prompt,
|
|
135
|
-
"voice_setting": {
|
|
136
|
-
"voice_id": inputs.voice_setting.voice_id,
|
|
137
|
-
"speed": inputs.voice_setting.speed,
|
|
138
|
-
"pitch": inputs.voice_setting.pitch,
|
|
139
|
-
"vol": inputs.voice_setting.vol,
|
|
140
|
-
"english_normalization": inputs.voice_setting.english_normalization,
|
|
141
|
-
},
|
|
142
|
-
"language_boost": inputs.language_boost,
|
|
143
|
-
"output_format": inputs.output_format,
|
|
144
|
-
"normalization_setting": {
|
|
145
|
-
"enabled": inputs.normalization_setting.enabled,
|
|
146
|
-
"target_loudness": inputs.normalization_setting.target_loudness,
|
|
147
|
-
"target_range": inputs.normalization_setting.target_range,
|
|
148
|
-
"target_peak": inputs.normalization_setting.target_peak,
|
|
149
|
-
},
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
# Submit async job and get handler
|
|
153
|
-
handler = await fal_client.submit_async(
|
|
154
|
-
"fal-ai/minimax/speech-2.6-turbo",
|
|
155
|
-
arguments=arguments,
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
# Store the external job ID for tracking
|
|
159
|
-
await context.set_external_job_id(handler.request_id)
|
|
160
|
-
|
|
161
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
162
|
-
from .....progress.models import ProgressUpdate
|
|
163
|
-
|
|
164
|
-
event_count = 0
|
|
165
|
-
async for event in handler.iter_events(with_logs=True):
|
|
166
|
-
event_count += 1
|
|
167
|
-
|
|
168
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
169
|
-
if event_count % 3 == 0:
|
|
170
|
-
# Extract logs if available
|
|
171
|
-
logs = getattr(event, "logs", None)
|
|
172
|
-
if logs:
|
|
173
|
-
# Join log entries into a single message
|
|
174
|
-
if isinstance(logs, list):
|
|
175
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
176
|
-
else:
|
|
177
|
-
message = str(logs)
|
|
178
|
-
|
|
179
|
-
if message:
|
|
180
|
-
await context.publish_progress(
|
|
181
|
-
ProgressUpdate(
|
|
182
|
-
job_id=handler.request_id,
|
|
183
|
-
status="processing",
|
|
184
|
-
progress=50.0, # Approximate mid-point progress
|
|
185
|
-
phase="processing",
|
|
186
|
-
message=message,
|
|
187
|
-
)
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
# Get final result
|
|
191
|
-
result = await handler.get()
|
|
192
|
-
|
|
193
|
-
# Extract audio URL from result
|
|
194
|
-
# fal.ai returns: {"audio": {"url": "..."}}
|
|
195
|
-
audio_data = result.get("audio")
|
|
196
|
-
if audio_data is None:
|
|
197
|
-
raise ValueError("No audio data returned from fal.ai API")
|
|
198
|
-
|
|
199
|
-
audio_url = audio_data.get("url")
|
|
200
|
-
if not audio_url:
|
|
201
|
-
raise ValueError("Audio URL missing in fal.ai response")
|
|
202
|
-
|
|
203
|
-
# Store audio result
|
|
204
|
-
artifact = await context.store_audio_result(
|
|
205
|
-
storage_url=audio_url,
|
|
206
|
-
format="mp3", # MiniMax Speech returns MP3 format
|
|
207
|
-
output_index=0,
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
return GeneratorResult(outputs=[artifact])
|
|
211
|
-
|
|
212
|
-
async def estimate_cost(self, inputs: MinimaxSpeech26TurboInput) -> float:
|
|
213
|
-
"""Estimate cost for MiniMax Speech 2.6 Turbo generation.
|
|
214
|
-
|
|
215
|
-
MiniMax Speech 2.6 Turbo costs $0.06 per 1000 characters.
|
|
216
|
-
"""
|
|
217
|
-
# Calculate character count
|
|
218
|
-
char_count = len(inputs.prompt)
|
|
219
|
-
|
|
220
|
-
# Cost is $0.06 per 1000 characters
|
|
221
|
-
return (char_count / 1000.0) * 0.06
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"""Fal.ai image generators."""
|
|
2
|
-
|
|
3
|
-
from .bytedance_seedream_v45_edit import FalBytedanceSeedreamV45EditGenerator
|
|
4
|
-
from .clarity_upscaler import FalClarityUpscalerGenerator
|
|
5
|
-
from .crystal_upscaler import FalCrystalUpscalerGenerator
|
|
6
|
-
from .fal_ideogram_character import FalIdeogramCharacterGenerator
|
|
7
|
-
from .flux_2 import FalFlux2Generator
|
|
8
|
-
from .flux_2_edit import FalFlux2EditGenerator
|
|
9
|
-
from .flux_2_pro import FalFlux2ProGenerator
|
|
10
|
-
from .flux_2_pro_edit import FalFlux2ProEditGenerator
|
|
11
|
-
from .flux_pro_kontext import FalFluxProKontextGenerator
|
|
12
|
-
from .flux_pro_ultra import FalFluxProUltraGenerator
|
|
13
|
-
from .gemini_25_flash_image import FalGemini25FlashImageGenerator
|
|
14
|
-
from .gemini_25_flash_image_edit import FalGemini25FlashImageEditGenerator
|
|
15
|
-
from .gpt_image_1_5 import FalGptImage15Generator
|
|
16
|
-
from .gpt_image_1_edit_image import FalGptImage1EditImageGenerator
|
|
17
|
-
from .gpt_image_1_mini import FalGptImage1MiniGenerator
|
|
18
|
-
from .gpt_image_15_edit import FalGptImage15EditGenerator
|
|
19
|
-
from .ideogram_character_edit import FalIdeogramCharacterEditGenerator
|
|
20
|
-
from .ideogram_v2 import FalIdeogramV2Generator
|
|
21
|
-
from .imagen4_preview import FalImagen4PreviewGenerator
|
|
22
|
-
from .imagen4_preview_fast import FalImagen4PreviewFastGenerator
|
|
23
|
-
from .nano_banana import FalNanoBananaGenerator
|
|
24
|
-
from .nano_banana_edit import FalNanoBananaEditGenerator
|
|
25
|
-
from .nano_banana_pro import FalNanoBananaProGenerator
|
|
26
|
-
from .nano_banana_pro_edit import FalNanoBananaProEditGenerator
|
|
27
|
-
from .qwen_image import FalQwenImageGenerator
|
|
28
|
-
from .qwen_image_edit import FalQwenImageEditGenerator
|
|
29
|
-
from .reve_edit import FalReveEditGenerator
|
|
30
|
-
from .reve_text_to_image import FalReveTextToImageGenerator
|
|
31
|
-
from .seedream_v45_text_to_image import FalSeedreamV45TextToImageGenerator
|
|
32
|
-
|
|
33
|
-
__all__ = [
|
|
34
|
-
"FalBytedanceSeedreamV45EditGenerator",
|
|
35
|
-
"FalClarityUpscalerGenerator",
|
|
36
|
-
"FalCrystalUpscalerGenerator",
|
|
37
|
-
"FalFlux2Generator",
|
|
38
|
-
"FalFlux2EditGenerator",
|
|
39
|
-
"FalFlux2ProGenerator",
|
|
40
|
-
"FalFlux2ProEditGenerator",
|
|
41
|
-
"FalFluxProKontextGenerator",
|
|
42
|
-
"FalFluxProUltraGenerator",
|
|
43
|
-
"FalGemini25FlashImageEditGenerator",
|
|
44
|
-
"FalGemini25FlashImageGenerator",
|
|
45
|
-
"FalGptImage15EditGenerator",
|
|
46
|
-
"FalGptImage15Generator",
|
|
47
|
-
"FalGptImage1EditImageGenerator",
|
|
48
|
-
"FalGptImage1MiniGenerator",
|
|
49
|
-
"FalIdeogramCharacterGenerator",
|
|
50
|
-
"FalIdeogramCharacterEditGenerator",
|
|
51
|
-
"FalIdeogramV2Generator",
|
|
52
|
-
"FalImagen4PreviewGenerator",
|
|
53
|
-
"FalImagen4PreviewFastGenerator",
|
|
54
|
-
"FalNanoBananaGenerator",
|
|
55
|
-
"FalNanoBananaEditGenerator",
|
|
56
|
-
"FalNanoBananaProGenerator",
|
|
57
|
-
"FalNanoBananaProEditGenerator",
|
|
58
|
-
"FalQwenImageEditGenerator",
|
|
59
|
-
"FalQwenImageGenerator",
|
|
60
|
-
"FalReveEditGenerator",
|
|
61
|
-
"FalReveTextToImageGenerator",
|
|
62
|
-
"FalSeedreamV45TextToImageGenerator",
|
|
63
|
-
]
|
package/templates/api/src/boards/generators/implementations/fal/image/bytedance_seedream_v45_edit.py
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai ByteDance Seedream v4.5 Edit image editing generator.
|
|
3
|
-
|
|
4
|
-
Edit images using fal.ai's ByteDance Seedream v4.5 Edit model.
|
|
5
|
-
A new-generation image creation model that integrates image generation
|
|
6
|
-
and image editing capabilities into a single, unified architecture.
|
|
7
|
-
Supports editing up to 10 input images with a text prompt.
|
|
8
|
-
|
|
9
|
-
See: https://fal.ai/models/fal-ai/bytedance/seedream/v4.5/edit
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
import os
|
|
13
|
-
from typing import Literal
|
|
14
|
-
|
|
15
|
-
from pydantic import BaseModel, Field
|
|
16
|
-
|
|
17
|
-
from ....artifacts import ImageArtifact
|
|
18
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
19
|
-
|
|
20
|
-
# Valid image size presets
|
|
21
|
-
ImageSizePreset = Literal[
|
|
22
|
-
"square_hd",
|
|
23
|
-
"square",
|
|
24
|
-
"portrait_4_3",
|
|
25
|
-
"portrait_16_9",
|
|
26
|
-
"landscape_4_3",
|
|
27
|
-
"landscape_16_9",
|
|
28
|
-
"auto_2K",
|
|
29
|
-
"auto_4K",
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class BytedanceSeedreamV45EditInput(BaseModel):
|
|
34
|
-
"""Input schema for ByteDance Seedream v4.5 Edit.
|
|
35
|
-
|
|
36
|
-
Artifact fields (like image_sources) are automatically detected via type
|
|
37
|
-
introspection and resolved from generation IDs to ImageArtifact objects.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
prompt: str = Field(description="The text prompt used to edit the image")
|
|
41
|
-
image_sources: list[ImageArtifact] = Field(
|
|
42
|
-
description="List of input images for editing (up to 10 images)",
|
|
43
|
-
min_length=1,
|
|
44
|
-
max_length=10,
|
|
45
|
-
)
|
|
46
|
-
num_images: int = Field(
|
|
47
|
-
default=1,
|
|
48
|
-
ge=1,
|
|
49
|
-
le=6,
|
|
50
|
-
description="Number of images to generate",
|
|
51
|
-
)
|
|
52
|
-
image_size: ImageSizePreset | None = Field(
|
|
53
|
-
default=None,
|
|
54
|
-
description=(
|
|
55
|
-
"The size of the generated image. Options: square_hd, square, "
|
|
56
|
-
"portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, "
|
|
57
|
-
"auto_2K, auto_4K. Default is 2048x2048"
|
|
58
|
-
),
|
|
59
|
-
)
|
|
60
|
-
seed: int | None = Field(
|
|
61
|
-
default=None,
|
|
62
|
-
description="Random seed to control the stochasticity of image generation",
|
|
63
|
-
)
|
|
64
|
-
sync_mode: bool = Field(
|
|
65
|
-
default=False,
|
|
66
|
-
description=(
|
|
67
|
-
"If True, the media will be returned as a data URI and the output "
|
|
68
|
-
"data won't be available in the request history"
|
|
69
|
-
),
|
|
70
|
-
)
|
|
71
|
-
enable_safety_checker: bool = Field(
|
|
72
|
-
default=True,
|
|
73
|
-
description="Enables safety filtering on generated images",
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class FalBytedanceSeedreamV45EditGenerator(BaseGenerator):
|
|
78
|
-
"""ByteDance Seedream v4.5 Edit image editing generator using fal.ai."""
|
|
79
|
-
|
|
80
|
-
name = "fal-bytedance-seedream-v45-edit"
|
|
81
|
-
artifact_type = "image"
|
|
82
|
-
description = "Fal: ByteDance Seedream v4.5 Edit - Unified image generation and editing"
|
|
83
|
-
|
|
84
|
-
def get_input_schema(self) -> type[BytedanceSeedreamV45EditInput]:
|
|
85
|
-
return BytedanceSeedreamV45EditInput
|
|
86
|
-
|
|
87
|
-
async def generate(
|
|
88
|
-
self, inputs: BytedanceSeedreamV45EditInput, context: GeneratorExecutionContext
|
|
89
|
-
) -> GeneratorResult:
|
|
90
|
-
"""Edit images using fal.ai ByteDance Seedream v4.5 Edit model."""
|
|
91
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
92
|
-
if not os.getenv("FAL_KEY"):
|
|
93
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
94
|
-
|
|
95
|
-
# Import fal_client
|
|
96
|
-
try:
|
|
97
|
-
import fal_client
|
|
98
|
-
except ImportError as e:
|
|
99
|
-
raise ImportError(
|
|
100
|
-
"fal.ai SDK is required for FalBytedanceSeedreamV45EditGenerator. "
|
|
101
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
102
|
-
) from e
|
|
103
|
-
|
|
104
|
-
# Upload image artifacts to Fal's public storage
|
|
105
|
-
# Fal API requires publicly accessible URLs, but our storage_url might be:
|
|
106
|
-
# - Localhost URLs (not publicly accessible)
|
|
107
|
-
# - Private S3 buckets (not publicly accessible)
|
|
108
|
-
# So we upload to Fal's temporary storage first
|
|
109
|
-
from ..utils import upload_artifacts_to_fal
|
|
110
|
-
|
|
111
|
-
image_urls = await upload_artifacts_to_fal(inputs.image_sources, context)
|
|
112
|
-
|
|
113
|
-
# Prepare arguments for fal.ai API
|
|
114
|
-
arguments: dict = {
|
|
115
|
-
"prompt": inputs.prompt,
|
|
116
|
-
"image_urls": image_urls,
|
|
117
|
-
"num_images": inputs.num_images,
|
|
118
|
-
"sync_mode": inputs.sync_mode,
|
|
119
|
-
"enable_safety_checker": inputs.enable_safety_checker,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
# Add optional parameters
|
|
123
|
-
if inputs.image_size is not None:
|
|
124
|
-
arguments["image_size"] = inputs.image_size
|
|
125
|
-
|
|
126
|
-
if inputs.seed is not None:
|
|
127
|
-
arguments["seed"] = inputs.seed
|
|
128
|
-
|
|
129
|
-
# Submit async job and get handler
|
|
130
|
-
handler = await fal_client.submit_async(
|
|
131
|
-
"fal-ai/bytedance/seedream/v4.5/edit",
|
|
132
|
-
arguments=arguments,
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
# Store the external job ID for tracking
|
|
136
|
-
await context.set_external_job_id(handler.request_id)
|
|
137
|
-
|
|
138
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
139
|
-
from .....progress.models import ProgressUpdate
|
|
140
|
-
|
|
141
|
-
event_count = 0
|
|
142
|
-
async for event in handler.iter_events(with_logs=True):
|
|
143
|
-
event_count += 1
|
|
144
|
-
|
|
145
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
146
|
-
if event_count % 3 == 0:
|
|
147
|
-
# Extract logs if available
|
|
148
|
-
logs = getattr(event, "logs", None)
|
|
149
|
-
if logs:
|
|
150
|
-
# Join log entries into a single message
|
|
151
|
-
if isinstance(logs, list):
|
|
152
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
153
|
-
else:
|
|
154
|
-
message = str(logs)
|
|
155
|
-
|
|
156
|
-
if message:
|
|
157
|
-
await context.publish_progress(
|
|
158
|
-
ProgressUpdate(
|
|
159
|
-
job_id=handler.request_id,
|
|
160
|
-
status="processing",
|
|
161
|
-
progress=50.0, # Approximate mid-point progress
|
|
162
|
-
phase="processing",
|
|
163
|
-
message=message,
|
|
164
|
-
)
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
# Get final result
|
|
168
|
-
result = await handler.get()
|
|
169
|
-
|
|
170
|
-
# Extract image URLs from result
|
|
171
|
-
# fal.ai returns: {
|
|
172
|
-
# "images": [{"url": "...", "width": ..., "height": ..., ...}, ...]
|
|
173
|
-
# }
|
|
174
|
-
images = result.get("images", [])
|
|
175
|
-
|
|
176
|
-
if not images:
|
|
177
|
-
raise ValueError("No images returned from fal.ai API")
|
|
178
|
-
|
|
179
|
-
# Store each image using output_index
|
|
180
|
-
artifacts = []
|
|
181
|
-
for idx, image_data in enumerate(images):
|
|
182
|
-
image_url = image_data.get("url")
|
|
183
|
-
# Extract dimensions if available, otherwise use sensible defaults
|
|
184
|
-
width = image_data.get("width", 2048)
|
|
185
|
-
height = image_data.get("height", 2048)
|
|
186
|
-
|
|
187
|
-
if not image_url:
|
|
188
|
-
raise ValueError(f"Image {idx} missing URL in fal.ai response")
|
|
189
|
-
|
|
190
|
-
# Determine format from content_type or default to png
|
|
191
|
-
content_type = image_data.get("content_type", "image/png")
|
|
192
|
-
if "jpeg" in content_type or "jpg" in content_type:
|
|
193
|
-
format_type = "jpeg"
|
|
194
|
-
elif "webp" in content_type:
|
|
195
|
-
format_type = "webp"
|
|
196
|
-
else:
|
|
197
|
-
format_type = "png"
|
|
198
|
-
|
|
199
|
-
# Store with appropriate output_index
|
|
200
|
-
artifact = await context.store_image_result(
|
|
201
|
-
storage_url=image_url,
|
|
202
|
-
format=format_type,
|
|
203
|
-
width=width,
|
|
204
|
-
height=height,
|
|
205
|
-
output_index=idx,
|
|
206
|
-
)
|
|
207
|
-
artifacts.append(artifact)
|
|
208
|
-
|
|
209
|
-
return GeneratorResult(outputs=artifacts)
|
|
210
|
-
|
|
211
|
-
async def estimate_cost(self, inputs: BytedanceSeedreamV45EditInput) -> float:
|
|
212
|
-
"""Estimate cost for ByteDance Seedream v4.5 Edit generation.
|
|
213
|
-
|
|
214
|
-
Pricing not disclosed in documentation, using conservative estimate
|
|
215
|
-
based on similar high-quality image editing models.
|
|
216
|
-
"""
|
|
217
|
-
# Conservative estimate per image
|
|
218
|
-
per_image_cost = 0.05
|
|
219
|
-
return per_image_cost * inputs.num_images
|