@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/beatoven_music_generation.py
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Beatoven music generation - royalty-free instrumental music generator.
|
|
3
|
-
|
|
4
|
-
Generate high-quality instrumental music from electronic, hip hop, and indie rock
|
|
5
|
-
to cinematic and classical genres. Designed for games, films, social content,
|
|
6
|
-
podcasts, and similar applications.
|
|
7
|
-
|
|
8
|
-
Based on Fal AI's beatoven/music-generation model.
|
|
9
|
-
See: https://fal.ai/models/beatoven/music-generation
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
import os
|
|
13
|
-
|
|
14
|
-
from pydantic import BaseModel, Field
|
|
15
|
-
|
|
16
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class BeatovenMusicGenerationInput(BaseModel):
|
|
20
|
-
"""Input schema for beatoven music generation.
|
|
21
|
-
|
|
22
|
-
All fields use appropriate types and validation based on the Fal AI API.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
prompt: str = Field(
|
|
26
|
-
description="Text description of the desired music (style, mood, instruments, tempo, etc.)"
|
|
27
|
-
)
|
|
28
|
-
duration: float = Field(
|
|
29
|
-
default=90,
|
|
30
|
-
ge=5,
|
|
31
|
-
le=150,
|
|
32
|
-
description="Duration of generated music in seconds (5-150)",
|
|
33
|
-
)
|
|
34
|
-
refinement: int = Field(
|
|
35
|
-
default=100,
|
|
36
|
-
ge=10,
|
|
37
|
-
le=200,
|
|
38
|
-
description="Quality improvement level (10-200, higher is better quality)",
|
|
39
|
-
)
|
|
40
|
-
creativity: float = Field(
|
|
41
|
-
default=16,
|
|
42
|
-
ge=1,
|
|
43
|
-
le=20,
|
|
44
|
-
description="Creative interpretation degree (1-20, higher is more creative)",
|
|
45
|
-
)
|
|
46
|
-
seed: int | None = Field(
|
|
47
|
-
default=None,
|
|
48
|
-
ge=0,
|
|
49
|
-
le=2147483647,
|
|
50
|
-
description="Seed for reproducible results (0-2147483647, null for random)",
|
|
51
|
-
)
|
|
52
|
-
negative_prompt: str = Field(
|
|
53
|
-
default="",
|
|
54
|
-
description="Elements to exclude from the generated music",
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class FalBeatovenMusicGenerationGenerator(BaseGenerator):
|
|
59
|
-
"""Beatoven music generation using fal.ai."""
|
|
60
|
-
|
|
61
|
-
name = "beatoven-music-generation"
|
|
62
|
-
artifact_type = "audio"
|
|
63
|
-
description = "Fal: Beatoven - generate royalty-free instrumental music from text prompts"
|
|
64
|
-
|
|
65
|
-
def get_input_schema(self) -> type[BeatovenMusicGenerationInput]:
|
|
66
|
-
return BeatovenMusicGenerationInput
|
|
67
|
-
|
|
68
|
-
async def generate(
|
|
69
|
-
self, inputs: BeatovenMusicGenerationInput, context: GeneratorExecutionContext
|
|
70
|
-
) -> GeneratorResult:
|
|
71
|
-
"""Generate music using fal.ai beatoven/music-generation model."""
|
|
72
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
73
|
-
if not os.getenv("FAL_KEY"):
|
|
74
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
75
|
-
|
|
76
|
-
# Import fal_client
|
|
77
|
-
try:
|
|
78
|
-
import fal_client
|
|
79
|
-
except ImportError as e:
|
|
80
|
-
raise ImportError(
|
|
81
|
-
"fal.ai SDK is required for FalBeatovenMusicGenerationGenerator. "
|
|
82
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
83
|
-
) from e
|
|
84
|
-
|
|
85
|
-
# Prepare arguments for fal.ai API
|
|
86
|
-
from typing import Any
|
|
87
|
-
|
|
88
|
-
arguments: dict[str, Any] = {
|
|
89
|
-
"prompt": inputs.prompt,
|
|
90
|
-
"duration": inputs.duration,
|
|
91
|
-
"refinement": inputs.refinement,
|
|
92
|
-
"creativity": inputs.creativity,
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
# Add optional parameters if provided
|
|
96
|
-
if inputs.seed is not None:
|
|
97
|
-
arguments["seed"] = inputs.seed
|
|
98
|
-
|
|
99
|
-
if inputs.negative_prompt:
|
|
100
|
-
arguments["negative_prompt"] = inputs.negative_prompt
|
|
101
|
-
|
|
102
|
-
# Submit async job and get handler
|
|
103
|
-
handler = await fal_client.submit_async(
|
|
104
|
-
"beatoven/music-generation",
|
|
105
|
-
arguments=arguments,
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
# Store the external job ID for tracking
|
|
109
|
-
await context.set_external_job_id(handler.request_id)
|
|
110
|
-
|
|
111
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
112
|
-
from .....progress.models import ProgressUpdate
|
|
113
|
-
|
|
114
|
-
event_count = 0
|
|
115
|
-
async for event in handler.iter_events(with_logs=True):
|
|
116
|
-
event_count += 1
|
|
117
|
-
|
|
118
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
119
|
-
if event_count % 3 == 0:
|
|
120
|
-
# Extract logs if available
|
|
121
|
-
logs = getattr(event, "logs", None)
|
|
122
|
-
if logs:
|
|
123
|
-
# Join log entries into a single message
|
|
124
|
-
if isinstance(logs, list):
|
|
125
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
126
|
-
else:
|
|
127
|
-
message = str(logs)
|
|
128
|
-
|
|
129
|
-
if message:
|
|
130
|
-
await context.publish_progress(
|
|
131
|
-
ProgressUpdate(
|
|
132
|
-
job_id=handler.request_id,
|
|
133
|
-
status="processing",
|
|
134
|
-
progress=50.0, # Approximate mid-point progress
|
|
135
|
-
phase="processing",
|
|
136
|
-
message=message,
|
|
137
|
-
)
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
# Get final result
|
|
141
|
-
result = await handler.get()
|
|
142
|
-
|
|
143
|
-
# Extract audio from result
|
|
144
|
-
# fal.ai returns: {"audio": {"url": "...", "content_type": "...", "file_size": ...}}
|
|
145
|
-
audio_data = result.get("audio")
|
|
146
|
-
if not audio_data:
|
|
147
|
-
raise ValueError("No audio returned from fal.ai API")
|
|
148
|
-
|
|
149
|
-
audio_url = audio_data.get("url")
|
|
150
|
-
if not audio_url:
|
|
151
|
-
raise ValueError("Audio missing URL in fal.ai response")
|
|
152
|
-
|
|
153
|
-
# Beatoven returns WAV format
|
|
154
|
-
audio_format = "wav"
|
|
155
|
-
|
|
156
|
-
# Store audio result
|
|
157
|
-
artifact = await context.store_audio_result(
|
|
158
|
-
storage_url=audio_url,
|
|
159
|
-
format=audio_format,
|
|
160
|
-
output_index=0,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
return GeneratorResult(outputs=[artifact])
|
|
164
|
-
|
|
165
|
-
async def estimate_cost(self, inputs: BeatovenMusicGenerationInput) -> float:
|
|
166
|
-
"""Estimate cost for beatoven music generation.
|
|
167
|
-
|
|
168
|
-
Estimated at approximately $0.05 per music generation.
|
|
169
|
-
Actual cost may vary based on duration and quality settings.
|
|
170
|
-
"""
|
|
171
|
-
return 0.05 # $0.05 per music generation
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai beatoven/sound-effect-generation generator.
|
|
3
|
-
|
|
4
|
-
Create professional-grade sound effects from animal and vehicle to nature, sci-fi,
|
|
5
|
-
and otherworldly sounds. Perfect for films, games, and digital content.
|
|
6
|
-
|
|
7
|
-
Based on Fal AI's beatoven/sound-effect-generation model.
|
|
8
|
-
See: https://fal.ai/models/beatoven/sound-effect-generation
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
import os
|
|
12
|
-
|
|
13
|
-
from pydantic import BaseModel, Field
|
|
14
|
-
|
|
15
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class BeatovenSoundEffectGenerationInput(BaseModel):
|
|
19
|
-
"""Input schema for beatoven/sound-effect-generation.
|
|
20
|
-
|
|
21
|
-
Artifact fields are automatically detected via type introspection
|
|
22
|
-
and resolved from generation IDs to artifact objects.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
prompt: str = Field(description="Describe the sound effect you want to generate")
|
|
26
|
-
duration: float = Field(
|
|
27
|
-
default=5,
|
|
28
|
-
ge=1,
|
|
29
|
-
le=35,
|
|
30
|
-
description="Length of the generated sound effect in seconds",
|
|
31
|
-
)
|
|
32
|
-
refinement: int = Field(
|
|
33
|
-
default=40,
|
|
34
|
-
ge=10,
|
|
35
|
-
le=200,
|
|
36
|
-
description="Refinement level - Higher values may improve quality but take longer",
|
|
37
|
-
)
|
|
38
|
-
creativity: float = Field(
|
|
39
|
-
default=16,
|
|
40
|
-
ge=1,
|
|
41
|
-
le=20,
|
|
42
|
-
description="Creativity level - higher values allow more creative interpretation",
|
|
43
|
-
)
|
|
44
|
-
negative_prompt: str = Field(
|
|
45
|
-
default="",
|
|
46
|
-
description="Describe the types of sounds you don't want to generate",
|
|
47
|
-
)
|
|
48
|
-
seed: int | None = Field(
|
|
49
|
-
default=None,
|
|
50
|
-
ge=0,
|
|
51
|
-
le=2147483647,
|
|
52
|
-
description="Random seed for reproducible results - leave empty for random generation",
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class FalBeatovenSoundEffectGenerationGenerator(BaseGenerator):
|
|
57
|
-
"""Generator for creating professional-grade sound effects."""
|
|
58
|
-
|
|
59
|
-
name = "fal-beatoven-sound-effect-generation"
|
|
60
|
-
description = (
|
|
61
|
-
"Fal: Beatoven Sound Effects - create professional-grade sound effects "
|
|
62
|
-
"for films, games, and digital content"
|
|
63
|
-
)
|
|
64
|
-
artifact_type = "audio"
|
|
65
|
-
|
|
66
|
-
def get_input_schema(self) -> type[BeatovenSoundEffectGenerationInput]:
|
|
67
|
-
"""Return the input schema for this generator."""
|
|
68
|
-
return BeatovenSoundEffectGenerationInput
|
|
69
|
-
|
|
70
|
-
async def generate(
|
|
71
|
-
self, inputs: BeatovenSoundEffectGenerationInput, context: GeneratorExecutionContext
|
|
72
|
-
) -> GeneratorResult:
|
|
73
|
-
"""Generate audio using fal.ai beatoven/sound-effect-generation."""
|
|
74
|
-
# Check for API key
|
|
75
|
-
if not os.getenv("FAL_KEY"):
|
|
76
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
77
|
-
|
|
78
|
-
# Import fal_client
|
|
79
|
-
try:
|
|
80
|
-
import fal_client
|
|
81
|
-
except ImportError as e:
|
|
82
|
-
raise ImportError(
|
|
83
|
-
"fal.ai SDK is required for FalBeatovenSoundEffectGenerationGenerator. "
|
|
84
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
85
|
-
) from e
|
|
86
|
-
|
|
87
|
-
# Prepare arguments for fal.ai API
|
|
88
|
-
from typing import Any
|
|
89
|
-
|
|
90
|
-
arguments: dict[str, Any] = {
|
|
91
|
-
"prompt": inputs.prompt,
|
|
92
|
-
"duration": inputs.duration,
|
|
93
|
-
"refinement": inputs.refinement,
|
|
94
|
-
"creativity": inputs.creativity,
|
|
95
|
-
"negative_prompt": inputs.negative_prompt,
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# Add seed if provided
|
|
99
|
-
if inputs.seed is not None:
|
|
100
|
-
arguments["seed"] = inputs.seed
|
|
101
|
-
|
|
102
|
-
# Submit async job
|
|
103
|
-
handler = await fal_client.submit_async(
|
|
104
|
-
"beatoven/sound-effect-generation",
|
|
105
|
-
arguments=arguments,
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
# Store external job ID
|
|
109
|
-
await context.set_external_job_id(handler.request_id)
|
|
110
|
-
|
|
111
|
-
# Stream progress updates
|
|
112
|
-
from .....progress.models import ProgressUpdate
|
|
113
|
-
|
|
114
|
-
event_count = 0
|
|
115
|
-
async for event in handler.iter_events(with_logs=True):
|
|
116
|
-
event_count += 1
|
|
117
|
-
# Sample every 3rd event to avoid spam
|
|
118
|
-
if event_count % 3 == 0:
|
|
119
|
-
# Extract logs if available
|
|
120
|
-
logs = getattr(event, "logs", None)
|
|
121
|
-
if logs:
|
|
122
|
-
# Join log entries into a single message
|
|
123
|
-
if isinstance(logs, list):
|
|
124
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
125
|
-
else:
|
|
126
|
-
message = str(logs)
|
|
127
|
-
|
|
128
|
-
if message:
|
|
129
|
-
await context.publish_progress(
|
|
130
|
-
ProgressUpdate(
|
|
131
|
-
job_id=handler.request_id,
|
|
132
|
-
status="processing",
|
|
133
|
-
progress=50.0,
|
|
134
|
-
phase="processing",
|
|
135
|
-
message=message,
|
|
136
|
-
)
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
# Get final result
|
|
140
|
-
result = await handler.get()
|
|
141
|
-
|
|
142
|
-
# Extract audio from result
|
|
143
|
-
# fal.ai returns: {"audio": {"url": "...", "content_type": "...", ...}}
|
|
144
|
-
audio_data = result.get("audio")
|
|
145
|
-
if not audio_data:
|
|
146
|
-
raise ValueError("No audio returned from fal.ai API")
|
|
147
|
-
|
|
148
|
-
audio_url = audio_data.get("url")
|
|
149
|
-
if not audio_url:
|
|
150
|
-
raise ValueError("Audio missing URL in fal.ai response")
|
|
151
|
-
|
|
152
|
-
# Store audio result (WAV format)
|
|
153
|
-
artifact = await context.store_audio_result(
|
|
154
|
-
storage_url=audio_url,
|
|
155
|
-
format="wav",
|
|
156
|
-
output_index=0,
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
return GeneratorResult(outputs=[artifact])
|
|
160
|
-
|
|
161
|
-
async def estimate_cost(self, inputs: BeatovenSoundEffectGenerationInput) -> float:
|
|
162
|
-
"""Estimate cost for this generation in USD.
|
|
163
|
-
|
|
164
|
-
Estimated at approximately $0.05 per sound effect generation.
|
|
165
|
-
Actual cost may vary based on duration and refinement settings.
|
|
166
|
-
"""
|
|
167
|
-
return 0.05
|
package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_text_to_speech.py
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
fal.ai Chatterbox Text-to-Speech generator.
|
|
3
|
-
|
|
4
|
-
Generate expressive speech from text using Resemble AI's Chatterbox model.
|
|
5
|
-
Supports emotive tags for natural expressions like laughing, sighing, and more.
|
|
6
|
-
|
|
7
|
-
Based on Fal AI's fal-ai/chatterbox/text-to-speech model.
|
|
8
|
-
See: https://fal.ai/models/fal-ai/chatterbox/text-to-speech
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
import os
|
|
12
|
-
|
|
13
|
-
from pydantic import BaseModel, Field
|
|
14
|
-
|
|
15
|
-
from ....base import BaseGenerator, GeneratorExecutionContext, GeneratorResult
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class ChatterboxTextToSpeechInput(BaseModel):
|
|
19
|
-
"""Input schema for Chatterbox text-to-speech generation.
|
|
20
|
-
|
|
21
|
-
Supports emotive tags: <laugh>, <chuckle>, <sigh>, <cough>,
|
|
22
|
-
<sniffle>, <groan>, <yawn>, <gasp>
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
text: str = Field(
|
|
26
|
-
description=(
|
|
27
|
-
"The text to be converted to speech. You can add emotive tags like "
|
|
28
|
-
"<laugh>, <chuckle>, <sigh>, <cough>, <sniffle>, <groan>, <yawn>, <gasp>"
|
|
29
|
-
),
|
|
30
|
-
min_length=1,
|
|
31
|
-
)
|
|
32
|
-
audio_url: str | None = Field(
|
|
33
|
-
default=None,
|
|
34
|
-
description=(
|
|
35
|
-
"Reference audio file URL for voice style matching. "
|
|
36
|
-
"If not provided, uses a default voice sample."
|
|
37
|
-
),
|
|
38
|
-
)
|
|
39
|
-
exaggeration: float = Field(
|
|
40
|
-
default=0.25,
|
|
41
|
-
ge=0.0,
|
|
42
|
-
le=1.0,
|
|
43
|
-
description="Speech exaggeration intensity factor (0.0 to 1.0)",
|
|
44
|
-
)
|
|
45
|
-
temperature: float = Field(
|
|
46
|
-
default=0.7,
|
|
47
|
-
ge=0.05,
|
|
48
|
-
le=2.0,
|
|
49
|
-
description="Creativity level for generation (0.05 to 2.0)",
|
|
50
|
-
)
|
|
51
|
-
cfg: float = Field(
|
|
52
|
-
default=0.5,
|
|
53
|
-
ge=0.1,
|
|
54
|
-
le=1.0,
|
|
55
|
-
description="Configuration parameter for generation (0.1 to 1.0)",
|
|
56
|
-
)
|
|
57
|
-
seed: int | None = Field(
|
|
58
|
-
default=None,
|
|
59
|
-
description="Random seed for reproducible audio generation",
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class FalChatterboxTextToSpeechGenerator(BaseGenerator):
|
|
64
|
-
"""Chatterbox text-to-speech generator using fal.ai.
|
|
65
|
-
|
|
66
|
-
Leverages Resemble AI's Chatterbox model to generate expressive speech
|
|
67
|
-
with support for emotive tags and voice cloning via reference audio.
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
name = "fal-chatterbox-text-to-speech"
|
|
71
|
-
artifact_type = "audio"
|
|
72
|
-
description = (
|
|
73
|
-
"Fal: Chatterbox TTS - Expressive text-to-speech with emotive tags and voice cloning"
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
def get_input_schema(self) -> type[ChatterboxTextToSpeechInput]:
|
|
77
|
-
return ChatterboxTextToSpeechInput
|
|
78
|
-
|
|
79
|
-
async def generate(
|
|
80
|
-
self, inputs: ChatterboxTextToSpeechInput, context: GeneratorExecutionContext
|
|
81
|
-
) -> GeneratorResult:
|
|
82
|
-
"""Generate audio using fal.ai Chatterbox text-to-speech model."""
|
|
83
|
-
# Check for API key (fal-client uses FAL_KEY environment variable)
|
|
84
|
-
if not os.getenv("FAL_KEY"):
|
|
85
|
-
raise ValueError("API configuration invalid. Missing FAL_KEY environment variable")
|
|
86
|
-
|
|
87
|
-
# Import fal_client
|
|
88
|
-
try:
|
|
89
|
-
import fal_client
|
|
90
|
-
except ImportError as e:
|
|
91
|
-
raise ImportError(
|
|
92
|
-
"fal.ai SDK is required for FalChatterboxTextToSpeechGenerator. "
|
|
93
|
-
"Install with: pip install weirdfingers-boards[generators-fal]"
|
|
94
|
-
) from e
|
|
95
|
-
|
|
96
|
-
# Prepare arguments for fal.ai API
|
|
97
|
-
arguments: dict = {
|
|
98
|
-
"text": inputs.text,
|
|
99
|
-
"exaggeration": inputs.exaggeration,
|
|
100
|
-
"temperature": inputs.temperature,
|
|
101
|
-
"cfg": inputs.cfg,
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# Add optional parameters if provided
|
|
105
|
-
if inputs.audio_url is not None:
|
|
106
|
-
arguments["audio_url"] = inputs.audio_url
|
|
107
|
-
if inputs.seed is not None:
|
|
108
|
-
arguments["seed"] = inputs.seed
|
|
109
|
-
|
|
110
|
-
# Submit async job and get handler
|
|
111
|
-
handler = await fal_client.submit_async(
|
|
112
|
-
"fal-ai/chatterbox/text-to-speech",
|
|
113
|
-
arguments=arguments,
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
# Store the external job ID for tracking
|
|
117
|
-
await context.set_external_job_id(handler.request_id)
|
|
118
|
-
|
|
119
|
-
# Stream progress updates (sample every 3rd event to avoid spam)
|
|
120
|
-
from .....progress.models import ProgressUpdate
|
|
121
|
-
|
|
122
|
-
event_count = 0
|
|
123
|
-
async for event in handler.iter_events(with_logs=True):
|
|
124
|
-
event_count += 1
|
|
125
|
-
|
|
126
|
-
# Process every 3rd event to provide feedback without overwhelming
|
|
127
|
-
if event_count % 3 == 0:
|
|
128
|
-
# Extract logs if available
|
|
129
|
-
logs = getattr(event, "logs", None)
|
|
130
|
-
if logs:
|
|
131
|
-
# Join log entries into a single message
|
|
132
|
-
if isinstance(logs, list):
|
|
133
|
-
message = " | ".join(str(log) for log in logs if log)
|
|
134
|
-
else:
|
|
135
|
-
message = str(logs)
|
|
136
|
-
|
|
137
|
-
if message:
|
|
138
|
-
await context.publish_progress(
|
|
139
|
-
ProgressUpdate(
|
|
140
|
-
job_id=handler.request_id,
|
|
141
|
-
status="processing",
|
|
142
|
-
progress=50.0, # Approximate mid-point progress
|
|
143
|
-
phase="processing",
|
|
144
|
-
message=message,
|
|
145
|
-
)
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
# Get final result
|
|
149
|
-
result = await handler.get()
|
|
150
|
-
|
|
151
|
-
# Extract audio URL from result
|
|
152
|
-
# fal.ai returns: {"audio": {"url": "..."}}
|
|
153
|
-
audio_data = result.get("audio")
|
|
154
|
-
if audio_data is None:
|
|
155
|
-
raise ValueError("No audio data returned from fal.ai API")
|
|
156
|
-
|
|
157
|
-
audio_url = audio_data.get("url")
|
|
158
|
-
if not audio_url:
|
|
159
|
-
raise ValueError("Audio URL missing in fal.ai response")
|
|
160
|
-
|
|
161
|
-
# Store audio result
|
|
162
|
-
artifact = await context.store_audio_result(
|
|
163
|
-
storage_url=audio_url,
|
|
164
|
-
format="mp3", # Chatterbox returns MP3 format
|
|
165
|
-
output_index=0,
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
return GeneratorResult(outputs=[artifact])
|
|
169
|
-
|
|
170
|
-
async def estimate_cost(self, inputs: ChatterboxTextToSpeechInput) -> float:
|
|
171
|
-
"""Estimate cost for Chatterbox text-to-speech generation.
|
|
172
|
-
|
|
173
|
-
Chatterbox pricing is approximately $0.03 per generation.
|
|
174
|
-
"""
|
|
175
|
-
# Fixed cost per generation
|
|
176
|
-
return 0.03
|