@weirdfingers/baseboards 0.9.5 → 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 +561 -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/chatterbox_tts_turbo.py
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai Chatterbox Text-to-Speech Turbo generator.
|
|
3
|
-
|
|
4
|
-
Generate expressive speech from text with paralinguistic controls like laughs,
|
|
5
|
-
sighs, coughs, and more. Supports voice cloning with custom audio samples.
|
|
6
|
-
|
|
7
|
-
Based on Fal AI's fal-ai/chatterbox/text-to-speech/turbo model.
|
|
8
|
-
See: https://fal.ai/models/fal-ai/chatterbox/text-to-speech/turbo
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
import os
|
|
12
|
-
from typing import Literal
|
|
13
|
-
|
|
14
|
-
from pydantic import BaseModel, Field
|
|
15
|
-
|
|
16
|
-
from ....artifacts import AudioArtifact
|
|
17
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
18
|
-
|
|
19
|
-
# Voice presets available in Chatterbox
|
|
20
|
-
ChatterboxVoice = Literal[
|
|
21
|
-
"aaron",
|
|
22
|
-
"abigail",
|
|
23
|
-
"anaya",
|
|
24
|
-
"andy",
|
|
25
|
-
"archer",
|
|
26
|
-
"brian",
|
|
27
|
-
"chloe",
|
|
28
|
-
"dylan",
|
|
29
|
-
"emmanuel",
|
|
30
|
-
"ethan",
|
|
31
|
-
"evelyn",
|
|
32
|
-
"gavin",
|
|
33
|
-
"gordon",
|
|
34
|
-
"ivan",
|
|
35
|
-
"laura",
|
|
36
|
-
"lucy",
|
|
37
|
-
"madison",
|
|
38
|
-
"marisol",
|
|
39
|
-
"meera",
|
|
40
|
-
"walter",
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class ChatterboxTtsTurboInput(BaseModel):
|
|
45
|
-
"""Input schema for Chatterbox TTS Turbo.
|
|
46
|
-
|
|
47
|
-
Artifact fields are automatically detected via type introspection
|
|
48
|
-
and resolved from generation IDs to artifact objects.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
text: str = Field(
|
|
52
|
-
description=(
|
|
53
|
-
"The text to be converted to speech. Supports paralinguistic tags: "
|
|
54
|
-
"[clear throat], [sigh], [shush], [cough], [groan], [sniff], [gasp], "
|
|
55
|
-
"[chuckle], [laugh]"
|
|
56
|
-
),
|
|
57
|
-
min_length=1,
|
|
58
|
-
)
|
|
59
|
-
voice: ChatterboxVoice = Field(
|
|
60
|
-
default="lucy",
|
|
61
|
-
description="Preset voice to use for synthesis",
|
|
62
|
-
)
|
|
63
|
-
audio_url: AudioArtifact | None = Field(
|
|
64
|
-
default=None,
|
|
65
|
-
description=(
|
|
66
|
-
"Optional audio file (5-10 seconds) for voice cloning. "
|
|
67
|
-
"If provided, this overrides the preset voice selection."
|
|
68
|
-
),
|
|
69
|
-
)
|
|
70
|
-
temperature: float = Field(
|
|
71
|
-
default=0.8,
|
|
72
|
-
ge=0.05,
|
|
73
|
-
le=2.0,
|
|
74
|
-
description="Temperature for generation. Higher values create more varied speech patterns.",
|
|
75
|
-
)
|
|
76
|
-
seed: int | None = Field(
|
|
77
|
-
default=None,
|
|
78
|
-
description="Random seed for reproducible results. Set for consistent generations.",
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
class FalChatterboxTtsTurboGenerator(BaseGenerator):
|
|
83
|
-
"""Chatterbox TTS Turbo text-to-speech generator using fal.ai."""
|
|
84
|
-
|
|
85
|
-
name = "fal-chatterbox-tts-turbo"
|
|
86
|
-
artifact_type = "audio"
|
|
87
|
-
description = (
|
|
88
|
-
"Fal: Chatterbox TTS Turbo - "
|
|
89
|
-
"Expressive text-to-speech with paralinguistic controls and voice cloning"
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
def get_input_schema(self) -> type[ChatterboxTtsTurboInput]:
|
|
93
|
-
return ChatterboxTtsTurboInput
|
|
94
|
-
|
|
95
|
-
async def generate(
|
|
96
|
-
self, inputs: ChatterboxTtsTurboInput, context: GeneratorExecutionContext
|
|
97
|
-
) -> GeneratorResult:
|
|
98
|
-
"""Generate audio using fal.ai Chatterbox TTS Turbo model."""
|
|
99
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
100
|
-
if not os.getenv("FAL_KEY"):
|
|
101
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
102
|
-
|
|
103
|
-
# Import fal_client
|
|
104
|
-
try:
|
|
105
|
-
import fal_client
|
|
106
|
-
except ImportError as e:
|
|
107
|
-
raise ImportError(
|
|
108
|
-
"fal.ai SDK is required for FalChatterboxTtsTurboGenerator. "
|
|
109
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
110
|
-
) from e
|
|
111
|
-
|
|
112
|
-
# Prepare arguments for fal.ai API
|
|
113
|
-
arguments: dict[str, str | float | int] = {
|
|
114
|
-
"text": inputs.text,
|
|
115
|
-
"voice": inputs.voice,
|
|
116
|
-
"temperature": inputs.temperature,
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
# Add seed if provided
|
|
120
|
-
if inputs.seed is not None:
|
|
121
|
-
arguments["seed"] = inputs.seed
|
|
122
|
-
|
|
123
|
-
# Handle voice cloning audio upload
|
|
124
|
-
if inputs.audio_url is not None:
|
|
125
|
-
from ..utils import upload_artifacts_to_fal
|
|
126
|
-
|
|
127
|
-
audio_urls = await upload_artifacts_to_fal([inputs.audio_url], context)
|
|
128
|
-
arguments["audio_url"] = audio_urls[0]
|
|
129
|
-
|
|
130
|
-
# Submit async job and get handler
|
|
131
|
-
handler = await fal_client.submit_async(
|
|
132
|
-
"fal-ai/chatterbox/text-to-speech/turbo",
|
|
133
|
-
arguments=arguments,
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
# Store the external job ID for tracking
|
|
137
|
-
await context.set_external_job_id(handler.request_id)
|
|
138
|
-
|
|
139
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
140
|
-
from .....progress.models import ProgressUpdate
|
|
141
|
-
|
|
142
|
-
event_count = 0
|
|
143
|
-
async for event in handler.iter_events(with_logs=True):
|
|
144
|
-
event_count += 1
|
|
145
|
-
|
|
146
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
147
|
-
if event_count % 3 == 0:
|
|
148
|
-
# Extract logs if available
|
|
149
|
-
logs = getattr(event, "logs", None)
|
|
150
|
-
if logs:
|
|
151
|
-
# Join log entries into a single message
|
|
152
|
-
if isinstance(logs, list):
|
|
153
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
154
|
-
else:
|
|
155
|
-
message = str(logs)
|
|
156
|
-
|
|
157
|
-
if message:
|
|
158
|
-
await context.publish_progress(
|
|
159
|
-
ProgressUpdate(
|
|
160
|
-
job_id=handler.request_id,
|
|
161
|
-
status="processing",
|
|
162
|
-
progress=50.0, # Approximate mid-point progress
|
|
163
|
-
phase="processing",
|
|
164
|
-
message=message,
|
|
165
|
-
)
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
# Get final result
|
|
169
|
-
result = await handler.get()
|
|
170
|
-
|
|
171
|
-
# Extract audio URL from result
|
|
172
|
-
# fal.ai returns: {"audio": {"url": "..."}}
|
|
173
|
-
audio_data = result.get("audio")
|
|
174
|
-
if audio_data is None:
|
|
175
|
-
raise ValueError("No audio data returned from fal.ai API")
|
|
176
|
-
|
|
177
|
-
audio_url = audio_data.get("url")
|
|
178
|
-
if not audio_url:
|
|
179
|
-
raise ValueError("Audio URL missing in fal.ai response")
|
|
180
|
-
|
|
181
|
-
# Store audio result
|
|
182
|
-
artifact = await context.store_audio_result(
|
|
183
|
-
storage_url=audio_url,
|
|
184
|
-
format="wav", # Chatterbox TTS returns WAV format
|
|
185
|
-
output_index=0,
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
return GeneratorResult(outputs=[artifact])
|
|
189
|
-
|
|
190
|
-
async def estimate_cost(self, inputs: ChatterboxTtsTurboInput) -> float:
|
|
191
|
-
"""Estimate cost for Chatterbox TTS Turbo generation.
|
|
192
|
-
|
|
193
|
-
Chatterbox TTS Turbo pricing is approximately $0.03 per generation.
|
|
194
|
-
"""
|
|
195
|
-
return 0.03
|
package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_sound_effects_v2.py
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai ElevenLabs Sound Effects V2 text-to-audio generator.
|
|
3
|
-
|
|
4
|
-
Generate sound effects from text descriptions using ElevenLabs advanced
|
|
5
|
-
sound effects model. Supports customizable duration, prompt influence,
|
|
6
|
-
and multiple output formats.
|
|
7
|
-
|
|
8
|
-
Based on Fal AI's fal-ai/elevenlabs/sound-effects/v2 model.
|
|
9
|
-
See: https://fal.ai/models/fal-ai/elevenlabs/sound-effects/v2
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
import os
|
|
13
|
-
from typing import Literal
|
|
14
|
-
|
|
15
|
-
from pydantic import BaseModel, Field
|
|
16
|
-
|
|
17
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ElevenlabsSoundEffectsV2Input(BaseModel):
|
|
21
|
-
"""Input schema for ElevenLabs Sound Effects V2 generation.
|
|
22
|
-
|
|
23
|
-
Generates custom sound effects from natural language descriptions with
|
|
24
|
-
configurable duration, prompt influence, and output format.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
text: str = Field(
|
|
28
|
-
description="Text describing the sound effect to generate",
|
|
29
|
-
examples=[
|
|
30
|
-
"Spacious braam suitable for high-impact movie trailer moments",
|
|
31
|
-
"A gentle wind chime tinkling in a soft breeze",
|
|
32
|
-
],
|
|
33
|
-
)
|
|
34
|
-
duration_seconds: float | None = Field(
|
|
35
|
-
default=None,
|
|
36
|
-
ge=0.5,
|
|
37
|
-
le=22.0,
|
|
38
|
-
description=(
|
|
39
|
-
"Duration in seconds (0.5-22). "
|
|
40
|
-
"If None, optimal duration will be determined from prompt."
|
|
41
|
-
),
|
|
42
|
-
)
|
|
43
|
-
prompt_influence: float = Field(
|
|
44
|
-
default=0.3,
|
|
45
|
-
ge=0.0,
|
|
46
|
-
le=1.0,
|
|
47
|
-
description="How closely to follow the prompt (0-1). Higher values mean less variation.",
|
|
48
|
-
)
|
|
49
|
-
output_format: Literal[
|
|
50
|
-
"mp3_22050_32",
|
|
51
|
-
"mp3_44100_32",
|
|
52
|
-
"mp3_44100_64",
|
|
53
|
-
"mp3_44100_96",
|
|
54
|
-
"mp3_44100_128",
|
|
55
|
-
"mp3_44100_192",
|
|
56
|
-
"pcm_8000",
|
|
57
|
-
"pcm_16000",
|
|
58
|
-
"pcm_22050",
|
|
59
|
-
"pcm_24000",
|
|
60
|
-
"pcm_44100",
|
|
61
|
-
"pcm_48000",
|
|
62
|
-
"ulaw_8000",
|
|
63
|
-
"alaw_8000",
|
|
64
|
-
"opus_48000_32",
|
|
65
|
-
"opus_48000_64",
|
|
66
|
-
"opus_48000_96",
|
|
67
|
-
"opus_48000_128",
|
|
68
|
-
"opus_48000_192",
|
|
69
|
-
] = Field(
|
|
70
|
-
default="mp3_44100_128",
|
|
71
|
-
description=(
|
|
72
|
-
"Output format of the generated audio. Formatted as codec_sample_rate_bitrate."
|
|
73
|
-
),
|
|
74
|
-
)
|
|
75
|
-
loop: bool = Field(
|
|
76
|
-
default=False,
|
|
77
|
-
description="Whether to create a sound effect that loops smoothly.",
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class FalElevenlabsSoundEffectsV2Generator(BaseGenerator):
|
|
82
|
-
"""ElevenLabs Sound Effects V2 text-to-audio generator using fal.ai."""
|
|
83
|
-
|
|
84
|
-
name = "fal-elevenlabs-sound-effects-v2"
|
|
85
|
-
artifact_type = "audio"
|
|
86
|
-
description = (
|
|
87
|
-
"Fal: ElevenLabs Sound Effects V2 - "
|
|
88
|
-
"Generate custom sound effects from text descriptions with advanced AI"
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
def get_input_schema(self) -> type[ElevenlabsSoundEffectsV2Input]:
|
|
92
|
-
return ElevenlabsSoundEffectsV2Input
|
|
93
|
-
|
|
94
|
-
async def generate(
|
|
95
|
-
self, inputs: ElevenlabsSoundEffectsV2Input, context: GeneratorExecutionContext
|
|
96
|
-
) -> GeneratorResult:
|
|
97
|
-
"""Generate sound effect using fal.ai ElevenLabs Sound Effects V2 model."""
|
|
98
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
99
|
-
if not os.getenv("FAL_KEY"):
|
|
100
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
101
|
-
|
|
102
|
-
# Import fal_client
|
|
103
|
-
try:
|
|
104
|
-
import fal_client
|
|
105
|
-
except ImportError as e:
|
|
106
|
-
raise ImportError(
|
|
107
|
-
"fal.ai SDK is required for FalElevenlabsSoundEffectsV2Generator. "
|
|
108
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
109
|
-
) from e
|
|
110
|
-
|
|
111
|
-
# Prepare arguments for fal.ai API
|
|
112
|
-
arguments = {
|
|
113
|
-
"text": inputs.text,
|
|
114
|
-
"prompt_influence": inputs.prompt_influence,
|
|
115
|
-
"output_format": inputs.output_format,
|
|
116
|
-
"loop": inputs.loop,
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
# Only include duration_seconds if specified
|
|
120
|
-
if inputs.duration_seconds is not None:
|
|
121
|
-
arguments["duration_seconds"] = inputs.duration_seconds
|
|
122
|
-
|
|
123
|
-
# Submit async job and get handler
|
|
124
|
-
handler = await fal_client.submit_async(
|
|
125
|
-
"fal-ai/elevenlabs/sound-effects/v2",
|
|
126
|
-
arguments=arguments,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
# Store the external job ID for tracking
|
|
130
|
-
await context.set_external_job_id(handler.request_id)
|
|
131
|
-
|
|
132
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
133
|
-
from .....progress.models import ProgressUpdate
|
|
134
|
-
|
|
135
|
-
event_count = 0
|
|
136
|
-
async for event in handler.iter_events(with_logs=True):
|
|
137
|
-
event_count += 1
|
|
138
|
-
|
|
139
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
140
|
-
if event_count % 3 == 0:
|
|
141
|
-
# Extract logs if available
|
|
142
|
-
logs = getattr(event, "logs", None)
|
|
143
|
-
if logs:
|
|
144
|
-
# Join log entries into a single message
|
|
145
|
-
if isinstance(logs, list):
|
|
146
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
147
|
-
else:
|
|
148
|
-
message = str(logs)
|
|
149
|
-
|
|
150
|
-
if message:
|
|
151
|
-
await context.publish_progress(
|
|
152
|
-
ProgressUpdate(
|
|
153
|
-
job_id=handler.request_id,
|
|
154
|
-
status="processing",
|
|
155
|
-
progress=50.0, # Approximate mid-point progress
|
|
156
|
-
phase="processing",
|
|
157
|
-
message=message,
|
|
158
|
-
)
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
# Get final result
|
|
162
|
-
result = await handler.get()
|
|
163
|
-
|
|
164
|
-
# Extract audio URL from result
|
|
165
|
-
# fal.ai returns: {"audio": {"url": "...", "content_type": "...", ...}}
|
|
166
|
-
audio_data = result.get("audio")
|
|
167
|
-
if audio_data is None:
|
|
168
|
-
raise ValueError("No audio data returned from fal.ai API")
|
|
169
|
-
|
|
170
|
-
audio_url = audio_data.get("url")
|
|
171
|
-
if not audio_url:
|
|
172
|
-
raise ValueError("Audio URL missing in fal.ai response")
|
|
173
|
-
|
|
174
|
-
# Extract format from output_format (e.g., "mp3_44100_128" -> "mp3")
|
|
175
|
-
format_parts = inputs.output_format.split("_")
|
|
176
|
-
audio_format = format_parts[0] if format_parts else "mp3"
|
|
177
|
-
|
|
178
|
-
# Store audio result
|
|
179
|
-
artifact = await context.store_audio_result(
|
|
180
|
-
storage_url=audio_url,
|
|
181
|
-
format=audio_format,
|
|
182
|
-
output_index=0,
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
return GeneratorResult(outputs=[artifact])
|
|
186
|
-
|
|
187
|
-
async def estimate_cost(self, inputs: ElevenlabsSoundEffectsV2Input) -> float:
|
|
188
|
-
"""Estimate cost for ElevenLabs Sound Effects V2 generation.
|
|
189
|
-
|
|
190
|
-
Based on typical ElevenLabs sound effects pricing.
|
|
191
|
-
Cost is approximately $0.055 per sound effect generation.
|
|
192
|
-
"""
|
|
193
|
-
# Fixed cost per generation regardless of duration or format
|
|
194
|
-
return 0.055
|
package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_tts_eleven_v3.py
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai ElevenLabs Text-to-Speech Eleven-V3 generator.
|
|
3
|
-
|
|
4
|
-
Generate high-quality speech from text using ElevenLabs' Eleven-V3 model,
|
|
5
|
-
offering natural-sounding voices with customizable parameters for stability,
|
|
6
|
-
similarity, style, and speed.
|
|
7
|
-
|
|
8
|
-
Based on Fal AI's fal-ai/elevenlabs/tts/eleven-v3 model.
|
|
9
|
-
See: https://fal.ai/models/fal-ai/elevenlabs/tts/eleven-v3
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
import os
|
|
13
|
-
|
|
14
|
-
from pydantic import BaseModel, Field
|
|
15
|
-
|
|
16
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class ElevenlabsTtsElevenV3Input(BaseModel):
|
|
20
|
-
"""Input schema for ElevenLabs TTS Eleven-V3 generation.
|
|
21
|
-
|
|
22
|
-
The text is converted to speech using advanced AI voice synthesis with
|
|
23
|
-
customizable voice characteristics and optional word-level timestamps.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
text: str = Field(
|
|
27
|
-
description="The text to convert to speech",
|
|
28
|
-
min_length=1,
|
|
29
|
-
)
|
|
30
|
-
voice: str = Field(
|
|
31
|
-
default="Rachel",
|
|
32
|
-
description=(
|
|
33
|
-
"Voice selection. Available voices: "
|
|
34
|
-
"Aria, Roger, Sarah, Laura, Charlie, George, Callum, River, Liam, "
|
|
35
|
-
"Charlotte, Alice, Matilda, Will, Jessica, Eric, Chris, Brian, "
|
|
36
|
-
"Daniel, Lily, Bill, Rachel"
|
|
37
|
-
),
|
|
38
|
-
)
|
|
39
|
-
stability: float = Field(
|
|
40
|
-
default=0.5,
|
|
41
|
-
ge=0.0,
|
|
42
|
-
le=1.0,
|
|
43
|
-
description="Voice stability. Higher values result in more consistent output",
|
|
44
|
-
)
|
|
45
|
-
similarity_boost: float = Field(
|
|
46
|
-
default=0.75,
|
|
47
|
-
ge=0.0,
|
|
48
|
-
le=1.0,
|
|
49
|
-
description="Similarity boost for voice matching",
|
|
50
|
-
)
|
|
51
|
-
style: float = Field(
|
|
52
|
-
default=0.0,
|
|
53
|
-
ge=0.0,
|
|
54
|
-
le=1.0,
|
|
55
|
-
description="Style exaggeration. Higher values add more expressiveness",
|
|
56
|
-
)
|
|
57
|
-
speed: float = Field(
|
|
58
|
-
default=1.0,
|
|
59
|
-
ge=0.7,
|
|
60
|
-
le=1.2,
|
|
61
|
-
description="Speech rate adjustment. 1.0 is normal speed",
|
|
62
|
-
)
|
|
63
|
-
timestamps: bool = Field(
|
|
64
|
-
default=False,
|
|
65
|
-
description="Whether to return timestamps for each word",
|
|
66
|
-
)
|
|
67
|
-
previous_text: str | None = Field(
|
|
68
|
-
default=None,
|
|
69
|
-
description="Context from prior content for improved continuity",
|
|
70
|
-
)
|
|
71
|
-
next_text: str | None = Field(
|
|
72
|
-
default=None,
|
|
73
|
-
description="Context for upcoming content for improved continuity",
|
|
74
|
-
)
|
|
75
|
-
language_code: str | None = Field(
|
|
76
|
-
default=None,
|
|
77
|
-
description="ISO 639-1 language code (limited model support)",
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class FalElevenlabsTtsElevenV3Generator(BaseGenerator):
|
|
82
|
-
"""ElevenLabs Text-to-Speech Eleven-V3 generator using fal.ai."""
|
|
83
|
-
|
|
84
|
-
name = "fal-elevenlabs-tts-eleven-v3"
|
|
85
|
-
artifact_type = "audio"
|
|
86
|
-
description = (
|
|
87
|
-
"Fal: ElevenLabs TTS Eleven-V3 - "
|
|
88
|
-
"High-quality text-to-speech with natural-sounding voices and customizable parameters"
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
def get_input_schema(self) -> type[ElevenlabsTtsElevenV3Input]:
|
|
92
|
-
return ElevenlabsTtsElevenV3Input
|
|
93
|
-
|
|
94
|
-
async def generate(
|
|
95
|
-
self, inputs: ElevenlabsTtsElevenV3Input, context: GeneratorExecutionContext
|
|
96
|
-
) -> GeneratorResult:
|
|
97
|
-
"""Generate audio using fal.ai ElevenLabs TTS Eleven-V3 model."""
|
|
98
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
99
|
-
if not os.getenv("FAL_KEY"):
|
|
100
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
101
|
-
|
|
102
|
-
# Import fal_client
|
|
103
|
-
try:
|
|
104
|
-
import fal_client
|
|
105
|
-
except ImportError as e:
|
|
106
|
-
raise ImportError(
|
|
107
|
-
"fal.ai SDK is required for FalElevenlabsTtsElevenV3Generator. "
|
|
108
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
109
|
-
) from e
|
|
110
|
-
|
|
111
|
-
# Prepare arguments for fal.ai API
|
|
112
|
-
arguments = {
|
|
113
|
-
"text": inputs.text,
|
|
114
|
-
"voice": inputs.voice,
|
|
115
|
-
"stability": inputs.stability,
|
|
116
|
-
"similarity_boost": inputs.similarity_boost,
|
|
117
|
-
"style": inputs.style,
|
|
118
|
-
"speed": inputs.speed,
|
|
119
|
-
"timestamps": inputs.timestamps,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
# Add optional context parameters if provided
|
|
123
|
-
if inputs.previous_text is not None:
|
|
124
|
-
arguments["previous_text"] = inputs.previous_text
|
|
125
|
-
if inputs.next_text is not None:
|
|
126
|
-
arguments["next_text"] = inputs.next_text
|
|
127
|
-
if inputs.language_code is not None:
|
|
128
|
-
arguments["language_code"] = inputs.language_code
|
|
129
|
-
|
|
130
|
-
# Submit async job and get handler
|
|
131
|
-
handler = await fal_client.submit_async(
|
|
132
|
-
"fal-ai/elevenlabs/tts/eleven-v3",
|
|
133
|
-
arguments=arguments,
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
# Store the external job ID for tracking
|
|
137
|
-
await context.set_external_job_id(handler.request_id)
|
|
138
|
-
|
|
139
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
140
|
-
from .....progress.models import ProgressUpdate
|
|
141
|
-
|
|
142
|
-
event_count = 0
|
|
143
|
-
async for event in handler.iter_events(with_logs=True):
|
|
144
|
-
event_count += 1
|
|
145
|
-
|
|
146
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
147
|
-
if event_count % 3 == 0:
|
|
148
|
-
# Extract logs if available
|
|
149
|
-
logs = getattr(event, "logs", None)
|
|
150
|
-
if logs:
|
|
151
|
-
# Join log entries into a single message
|
|
152
|
-
if isinstance(logs, list):
|
|
153
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
154
|
-
else:
|
|
155
|
-
message = str(logs)
|
|
156
|
-
|
|
157
|
-
if message:
|
|
158
|
-
await context.publish_progress(
|
|
159
|
-
ProgressUpdate(
|
|
160
|
-
job_id=handler.request_id,
|
|
161
|
-
status="processing",
|
|
162
|
-
progress=50.0, # Approximate mid-point progress
|
|
163
|
-
phase="processing",
|
|
164
|
-
message=message,
|
|
165
|
-
)
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
# Get final result
|
|
169
|
-
result = await handler.get()
|
|
170
|
-
|
|
171
|
-
# Extract audio URL from result
|
|
172
|
-
# fal.ai returns: {"audio": {"url": "...", "content_type": "...", ...}}
|
|
173
|
-
audio_data = result.get("audio")
|
|
174
|
-
if audio_data is None:
|
|
175
|
-
raise ValueError("No audio data returned from fal.ai API")
|
|
176
|
-
|
|
177
|
-
audio_url = audio_data.get("url")
|
|
178
|
-
if not audio_url:
|
|
179
|
-
raise ValueError("Audio URL missing in fal.ai response")
|
|
180
|
-
|
|
181
|
-
# Determine format from content_type or default to mp3
|
|
182
|
-
content_type = audio_data.get("content_type", "audio/mpeg")
|
|
183
|
-
format_map = {
|
|
184
|
-
"audio/mpeg": "mp3",
|
|
185
|
-
"audio/mp3": "mp3",
|
|
186
|
-
"audio/wav": "wav",
|
|
187
|
-
"audio/ogg": "ogg",
|
|
188
|
-
}
|
|
189
|
-
audio_format = format_map.get(content_type, "mp3")
|
|
190
|
-
|
|
191
|
-
# Store audio result
|
|
192
|
-
artifact = await context.store_audio_result(
|
|
193
|
-
storage_url=audio_url,
|
|
194
|
-
format=audio_format,
|
|
195
|
-
output_index=0,
|
|
196
|
-
)
|
|
197
|
-
|
|
198
|
-
return GeneratorResult(outputs=[artifact])
|
|
199
|
-
|
|
200
|
-
async def estimate_cost(self, inputs: ElevenlabsTtsElevenV3Input) -> float:
|
|
201
|
-
"""Estimate cost for ElevenLabs TTS Eleven-V3 generation.
|
|
202
|
-
|
|
203
|
-
ElevenLabs TTS Eleven-V3 costs $0.10 per 1000 characters.
|
|
204
|
-
"""
|
|
205
|
-
# Calculate character count
|
|
206
|
-
char_count = len(inputs.text)
|
|
207
|
-
|
|
208
|
-
# Cost is $0.10 per 1000 characters
|
|
209
|
-
return (char_count / 1000.0) * 0.10
|