From 3373100f34bd33b60dd32e9853d8f3428cd1ff05 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 2 Jun 2025 01:30:37 -0400 Subject: [PATCH] vendor in fal-rs @ 512e1c1009b4f98a5da54efd5ad3e49f0a0c2e0b --- crates/vendor/fal-rs/.cursorignore | 1 + .../fal-rs/.github/workflows/bump-version.yml | 68 + .../fal-rs/.github/workflows/check-fmt.yml | 28 + .../vendor/fal-rs/.github/workflows/check.yml | 26 + .../fal-rs/.github/workflows/generate.yml | 49 + .../fal-rs/.github/workflows/publish.yml | 70 + .../vendor/fal-rs/.github/workflows/test.yml | 28 + crates/vendor/fal-rs/.gitignore | 10 + crates/vendor/fal-rs/.vscode/settings.json | 3 + crates/vendor/fal-rs/Cargo.toml | 280 ++ crates/vendor/fal-rs/LICENSE-APACHE | 201 ++ crates/vendor/fal-rs/LICENSE-MIT | 21 + crates/vendor/fal-rs/README.md | 178 ++ crates/vendor/fal-rs/fal-derive/Cargo.toml | 17 + crates/vendor/fal-rs/fal-derive/README.md | 25 + crates/vendor/fal-rs/fal-derive/src/lib.rs | 133 + crates/vendor/fal-rs/generate/Cargo.toml | 16 + crates/vendor/fal-rs/generate/src/fal_data.rs | 47 + crates/vendor/fal-rs/generate/src/helpers.rs | 55 + crates/vendor/fal-rs/generate/src/main.rs | 292 ++ crates/vendor/fal-rs/generate/src/module.rs | 309 +++ crates/vendor/fal-rs/generate/src/types.rs | 292 ++ .../easel_ai/advanced_face_swap/mod.rs | 107 + .../fal-rs/src/endpoints/easel_ai/mod.rs | 14 + .../frame_interpolation/mod.rs | 89 + .../endpoints/fal_ai/amt_interpolation/mod.rs | 104 + .../fal_ai/animatediff_sparsectrl_lcm/mod.rs | 103 + .../endpoints/fal_ai/animatediff_v2v/mod.rs | 180 ++ .../fal_ai/animatediff_v2v/turbo/mod.rs | 165 ++ .../src/endpoints/fal_ai/any_llm/mod.rs | 114 + .../endpoints/fal_ai/any_llm/vision/mod.rs | 99 + .../src/endpoints/fal_ai/aura_flow/mod.rs | 90 + .../src/endpoints/fal_ai/aura_sr/mod.rs | 95 + .../src/endpoints/fal_ai/auto_caption/mod.rs | 76 + .../fal-rs/src/endpoints/fal_ai/ben/mod.rs | 14 + .../src/endpoints/fal_ai/ben/v2/image/mod.rs | 118 + .../fal-rs/src/endpoints/fal_ai/ben/v2/mod.rs | 28 + .../src/endpoints/fal_ai/ben/v2/video/mod.rs | 118 + .../src/endpoints/fal_ai/birefnet/mod.rs | 145 + .../src/endpoints/fal_ai/birefnet/v2/mod.rs | 130 + .../endpoints/fal_ai/bria/background/mod.rs | 28 + .../fal_ai/bria/background/remove/mod.rs | 445 ++++ .../fal_ai/bria/background/replace/mod.rs | 445 ++++ .../src/endpoints/fal_ai/bria/eraser/mod.rs | 445 ++++ .../src/endpoints/fal_ai/bria/expand/mod.rs | 447 ++++ .../src/endpoints/fal_ai/bria/genfill/mod.rs | 445 ++++ .../fal-rs/src/endpoints/fal_ai/bria/mod.rs | 112 + .../endpoints/fal_ai/bria/product_shot/mod.rs | 445 ++++ .../endpoints/fal_ai/bria/reimagine/mod.rs | 445 ++++ .../fal_ai/bria/text_to_image/base/mod.rs | 445 ++++ .../fal_ai/bria/text_to_image/fast/mod.rs | 445 ++++ .../fal_ai/bria/text_to_image/hd/mod.rs | 445 ++++ .../fal_ai/bria/text_to_image/mod.rs | 42 + .../src/endpoints/fal_ai/bria/upscale/mod.rs | 445 ++++ .../src/endpoints/fal_ai/cat_vton/mod.rs | 131 + .../fal-rs/src/endpoints/fal_ai/ccsr/mod.rs | 114 + .../endpoints/fal_ai/clarity_upscaler/mod.rs | 159 ++ .../src/endpoints/fal_ai/codeformer/mod.rs | 92 + .../fal_ai/cogvideox_5b/image_to_video/mod.rs | 224 ++ .../src/endpoints/fal_ai/cogvideox_5b/mod.rs | 253 ++ .../fal_ai/cogvideox_5b/video_to_video/mod.rs | 224 ++ .../src/endpoints/fal_ai/cogview4/mod.rs | 149 ++ .../src/endpoints/fal_ai/controlnext/mod.rs | 123 + .../endpoints/fal_ai/creative_upscaler/mod.rs | 143 + .../fal-rs/src/endpoints/fal_ai/csm_1b/mod.rs | 88 + .../src/endpoints/fal_ai/ddcolor/mod.rs | 74 + .../src/endpoints/fal_ai/diffrhythm/mod.rs | 84 + .../endpoints/fal_ai/diffusion_edge/mod.rs | 67 + .../src/endpoints/fal_ai/docres/dewarp/mod.rs | 88 + .../fal-rs/src/endpoints/fal_ai/docres/mod.rs | 103 + .../fal_ai/drct_super_resolution/mod.rs | 76 + .../fal_ai/dreamshaper/image_to_image/mod.rs | 300 +++ .../fal_ai/dreamshaper/inpainting/mod.rs | 300 +++ .../src/endpoints/fal_ai/dreamshaper/mod.rs | 329 +++ .../src/endpoints/fal_ai/dubbing/mod.rs | 70 + .../fal-rs/src/endpoints/fal_ai/dwpose/mod.rs | 70 + .../fal_ai/elevenlabs/audio_isolation/mod.rs | 203 ++ .../fal_ai/elevenlabs/clone_voice/mod.rs | 200 ++ .../src/endpoints/fal_ai/elevenlabs/mod.rs | 70 + .../fal_ai/elevenlabs/sound_effects/mod.rs | 203 ++ .../fal_ai/elevenlabs/speech_to_text/mod.rs | 203 ++ .../endpoints/fal_ai/elevenlabs/tts/mod.rs | 28 + .../elevenlabs/tts/multilingual_v2/mod.rs | 201 ++ .../fal_ai/elevenlabs/tts/turbo_v2_5/mod.rs | 201 ++ .../fal-rs/src/endpoints/fal_ai/era_3d/mod.rs | 127 + .../fal-rs/src/endpoints/fal_ai/esrgan/mod.rs | 124 + .../src/endpoints/fal_ai/evf_sam/mod.rs | 88 + .../src/endpoints/fal_ai/eye_correct/mod.rs | 61 + .../fal-rs/src/endpoints/fal_ai/f5_tts/mod.rs | 74 + .../endpoints/fal_ai/face_to_sticker/mod.rs | 164 ++ .../endpoints/fal_ai/fast_animatediff/mod.rs | 42 + .../fast_animatediff/text_to_video/mod.rs | 245 ++ .../fal_ai/fast_animatediff/turbo/mod.rs | 28 + .../turbo/text_to_video/mod.rs | 245 ++ .../turbo/video_to_video/mod.rs | 245 ++ .../fast_animatediff/video_to_video/mod.rs | 245 ++ .../fast_fooocus_sdxl/image_to_image/mod.rs | 285 ++ .../fast_fooocus_sdxl/inpainting/mod.rs | 283 ++ .../endpoints/fal_ai/fast_fooocus_sdxl/mod.rs | 314 +++ .../fast_lcm_diffusion/image_to_image/mod.rs | 306 +++ .../fast_lcm_diffusion/inpainting/mod.rs | 306 +++ .../fal_ai/fast_lcm_diffusion/mod.rs | 335 +++ .../fast_lightning_sdxl/image_to_image/mod.rs | 238 ++ .../fast_lightning_sdxl/inpainting/mod.rs | 238 ++ .../fal_ai/fast_lightning_sdxl/mod.rs | 267 ++ .../fal_ai/fast_sdxl/image_to_image/mod.rs | 312 +++ .../fal_ai/fast_sdxl/inpainting/mod.rs | 312 +++ .../src/endpoints/fal_ai/fast_sdxl/mod.rs | 341 +++ .../image_to_image/mod.rs | 267 ++ .../inpainting/mod.rs | 267 ++ .../fal_ai/fast_sdxl_controlnet_canny/mod.rs | 296 +++ .../src/endpoints/fal_ai/fast_svd/mod.rs | 179 ++ .../fal_ai/fast_svd/text_to_video/mod.rs | 164 ++ .../src/endpoints/fal_ai/fast_svd_lcm/mod.rs | 166 ++ .../fal_ai/fast_svd_lcm/text_to_video/mod.rs | 151 ++ .../image_to_image/mod.rs | 253 ++ .../fast_turbo_diffusion/inpainting/mod.rs | 251 ++ .../fal_ai/fast_turbo_diffusion/mod.rs | 282 ++ .../fal_ai/ffmpeg_api/compose/mod.rs | 220 ++ .../fal_ai/ffmpeg_api/metadata/mod.rs | 220 ++ .../src/endpoints/fal_ai/ffmpeg_api/mod.rs | 42 + .../fal_ai/ffmpeg_api/waveform/mod.rs | 220 ++ .../fal_ai/florence_2_large/caption/mod.rs | 186 ++ .../caption_to_phrase_grounding/mod.rs | 191 ++ .../dense_region_caption/mod.rs | 188 ++ .../florence_2_large/detailed_caption/mod.rs | 186 ++ .../endpoints/fal_ai/florence_2_large/mod.rs | 196 ++ .../more_detailed_caption/mod.rs | 186 ++ .../florence_2_large/object_detection/mod.rs | 186 ++ .../fal_ai/florence_2_large/ocr/mod.rs | 186 ++ .../florence_2_large/ocr_with_region/mod.rs | 188 ++ .../open_vocabulary_detection/mod.rs | 188 ++ .../referring_expression_segmentation/mod.rs | 191 ++ .../florence_2_large/region_proposal/mod.rs | 186 ++ .../region_to_category/mod.rs | 188 ++ .../region_to_description/mod.rs | 188 ++ .../region_to_segmentation/mod.rs | 188 ++ .../src/endpoints/fal_ai/flowedit/mod.rs | 101 + .../fal_ai/flux/dev/image_to_image/mod.rs | 245 ++ .../src/endpoints/fal_ai/flux/dev/mod.rs | 274 ++ .../endpoints/fal_ai/flux/dev/redux/mod.rs | 245 ++ .../fal-rs/src/endpoints/fal_ai/flux/mod.rs | 274 ++ .../src/endpoints/fal_ai/flux/schnell/mod.rs | 260 ++ .../fal_ai/flux/schnell/redux/mod.rs | 245 ++ .../image_to_image/mod.rs | 198 ++ .../fal_ai/flux_control_lora_canny/mod.rs | 213 ++ .../image_to_image/mod.rs | 198 ++ .../fal_ai/flux_control_lora_depth/mod.rs | 213 ++ .../fal_ai/flux_differential_diffusion/mod.rs | 97 + .../differential_diffusion/mod.rs | 661 +++++ .../fal_ai/flux_general/image_to_image/mod.rs | 659 +++++ .../fal_ai/flux_general/inpainting/mod.rs | 659 +++++ .../src/endpoints/fal_ai/flux_general/mod.rs | 716 +++++ .../fal_ai/flux_general/rf_inversion/mod.rs | 659 +++++ .../fal_ai/flux_lora/image_to_image/mod.rs | 235 ++ .../fal_ai/flux_lora/inpainting/mod.rs | 235 ++ .../src/endpoints/fal_ai/flux_lora/mod.rs | 264 ++ .../endpoints/fal_ai/flux_lora_canny/mod.rs | 143 + .../endpoints/fal_ai/flux_lora_depth/mod.rs | 143 + .../fal_ai/flux_lora_fast_training/mod.rs | 105 + .../endpoints/fal_ai/flux_lora_fill/mod.rs | 177 ++ .../fal_ai/flux_lora_portrait_trainer/mod.rs | 93 + .../fal_ai/flux_pro/finetuned/mod.rs | 650 +++++ .../src/endpoints/fal_ai/flux_pro/mod.rs | 733 +++++ .../src/endpoints/fal_ai/flux_pro/new/mod.rs | 648 +++++ .../endpoints/fal_ai/flux_pro/v1/canny/mod.rs | 648 +++++ .../fal_ai/flux_pro/v1/canny_finetuned/mod.rs | 650 +++++ .../endpoints/fal_ai/flux_pro/v1/depth/mod.rs | 648 +++++ .../fal_ai/flux_pro/v1/depth_finetuned/mod.rs | 650 +++++ .../endpoints/fal_ai/flux_pro/v1/fill/mod.rs | 648 +++++ .../fal_ai/flux_pro/v1/fill_finetuned/mod.rs | 650 +++++ .../src/endpoints/fal_ai/flux_pro/v1/mod.rs | 112 + .../fal_ai/flux_pro/v1/outpaint/mod.rs | 648 +++++ .../endpoints/fal_ai/flux_pro/v1/redux/mod.rs | 648 +++++ .../src/endpoints/fal_ai/flux_pro/v1_1/mod.rs | 665 +++++ .../fal_ai/flux_pro/v1_1/redux/mod.rs | 648 +++++ .../fal_ai/flux_pro/v1_1_ultra/mod.rs | 665 +++++ .../fal_ai/flux_pro/v1_1_ultra/redux/mod.rs | 650 +++++ .../flux_pro/v1_1_ultra_finetuned/mod.rs | 650 +++++ .../endpoints/fal_ai/flux_pro_trainer/mod.rs | 85 + .../src/endpoints/fal_ai/flux_pulid/mod.rs | 136 + .../src/endpoints/fal_ai/flux_subject/mod.rs | 126 + .../fal_ai/fooocus/image_prompt/mod.rs | 481 ++++ .../endpoints/fal_ai/fooocus/inpaint/mod.rs | 479 ++++ .../src/endpoints/fal_ai/fooocus/mod.rs | 522 ++++ .../fal_ai/fooocus/upscale_or_vary/mod.rs | 481 ++++ .../endpoints/fal_ai/gemini_flash_edit/mod.rs | 142 + .../fal_ai/gemini_flash_edit/multi/mod.rs | 127 + .../src/endpoints/fal_ai/got_ocr/mod.rs | 14 + .../src/endpoints/fal_ai/got_ocr/v2/mod.rs | 48 + .../src/endpoints/fal_ai/hunyuan3d/mod.rs | 14 + .../endpoints/fal_ai/hunyuan3d/v2/mini/mod.rs | 135 + .../fal_ai/hunyuan3d/v2/mini/turbo/mod.rs | 120 + .../src/endpoints/fal_ai/hunyuan3d/v2/mod.rs | 163 ++ .../fal_ai/hunyuan3d/v2/multi_view/mod.rs | 137 + .../hunyuan3d/v2/multi_view/turbo/mod.rs | 122 + .../fal_ai/hunyuan3d/v2/turbo/mod.rs | 120 + .../src/endpoints/fal_ai/hunyuan_video/mod.rs | 147 ++ .../hunyuan_video/video_to_video/mod.rs | 135 + .../hunyuan_video_image_to_video/mod.rs | 83 + .../fal_ai/hunyuan_video_img2vid_lora/mod.rs | 77 + .../fal_ai/hunyuan_video_lora/mod.rs | 151 ++ .../hunyuan_video_lora/video_to_video/mod.rs | 139 + .../fal_ai/hunyuan_video_lora_training/mod.rs | 118 + .../src/endpoints/fal_ai/hyper3d/mod.rs | 14 + .../src/endpoints/fal_ai/hyper3d/rodin/mod.rs | 190 ++ .../fal_ai/hyper_sdxl/image_to_image/mod.rs | 236 ++ .../fal_ai/hyper_sdxl/inpainting/mod.rs | 234 ++ .../src/endpoints/fal_ai/hyper_sdxl/mod.rs | 263 ++ .../src/endpoints/fal_ai/iclight_v2/mod.rs | 152 ++ .../src/endpoints/fal_ai/ideogram/mod.rs | 42 + .../endpoints/fal_ai/ideogram/upscale/mod.rs | 157 ++ .../endpoints/fal_ai/ideogram/v2/edit/mod.rs | 157 ++ .../src/endpoints/fal_ai/ideogram/v2/mod.rs | 200 ++ .../endpoints/fal_ai/ideogram/v2/remix/mod.rs | 157 ++ .../fal_ai/ideogram/v2/turbo/edit/mod.rs | 157 ++ .../endpoints/fal_ai/ideogram/v2/turbo/mod.rs | 186 ++ .../fal_ai/ideogram/v2/turbo/remix/mod.rs | 157 ++ .../src/endpoints/fal_ai/ideogram/v2a/mod.rs | 186 ++ .../fal_ai/ideogram/v2a/remix/mod.rs | 157 ++ .../fal_ai/ideogram/v2a/turbo/mod.rs | 172 ++ .../fal_ai/ideogram/v2a/turbo/remix/mod.rs | 157 ++ .../fal_ai/illusion_diffusion/mod.rs | 147 ++ .../fal_ai/image_preprocessors/canny/mod.rs | 281 ++ .../image_preprocessors/depth_anything/mod.rs | 14 + .../depth_anything/v2/mod.rs | 281 ++ .../fal_ai/image_preprocessors/hed/mod.rs | 281 ++ .../fal_ai/image_preprocessors/lineart/mod.rs | 281 ++ .../fal_ai/image_preprocessors/midas/mod.rs | 281 ++ .../fal_ai/image_preprocessors/mlsd/mod.rs | 281 ++ .../fal_ai/image_preprocessors/mod.rs | 154 ++ .../fal_ai/image_preprocessors/pidi/mod.rs | 281 ++ .../fal_ai/image_preprocessors/sam/mod.rs | 281 ++ .../image_preprocessors/scribble/mod.rs | 281 ++ .../fal_ai/image_preprocessors/teed/mod.rs | 281 ++ .../fal_ai/image_preprocessors/zoe/mod.rs | 281 ++ .../src/endpoints/fal_ai/imagen3/fast/mod.rs | 116 + .../src/endpoints/fal_ai/imagen3/mod.rs | 146 + .../fal_ai/imagen3/subject_reference/mod.rs | 120 + .../endpoints/fal_ai/imageutils/depth/mod.rs | 216 ++ .../endpoints/fal_ai/imageutils/esrgan/mod.rs | 216 ++ .../fal_ai/imageutils/marigold_depth/mod.rs | 218 ++ .../src/endpoints/fal_ai/imageutils/mod.rs | 84 + .../endpoints/fal_ai/imageutils/nsfw/mod.rs | 218 ++ .../endpoints/fal_ai/imageutils/rembg/mod.rs | 218 ++ .../endpoints/fal_ai/imageutils/sam/mod.rs | 216 ++ .../src/endpoints/fal_ai/inpaint/mod.rs | 105 + .../fal_ai/invisible_watermark/mod.rs | 73 + .../fal_ai/ip_adapter_face_id/mod.rs | 134 + .../fal-rs/src/endpoints/fal_ai/janus/mod.rs | 119 + .../fal-rs/src/endpoints/fal_ai/kling/mod.rs | 14 + .../kling/v1_5/kolors_virtual_try_on/mod.rs | 114 + .../src/endpoints/fal_ai/kling/v1_5/mod.rs | 14 + .../src/endpoints/fal_ai/kling_video/mod.rs | 42 + .../endpoints/fal_ai/kling_video/v1/mod.rs | 28 + .../fal_ai/kling_video/v1/pro/effects/mod.rs | 239 ++ .../kling_video/v1/pro/image_to_video/mod.rs | 241 ++ .../fal_ai/kling_video/v1/pro/mod.rs | 42 + .../kling_video/v1/pro/text_to_video/mod.rs | 239 ++ .../kling_video/v1/standard/effects/mod.rs | 239 ++ .../v1/standard/image_to_video/mod.rs | 241 ++ .../fal_ai/kling_video/v1/standard/mod.rs | 42 + .../v1/standard/text_to_video/mod.rs | 239 ++ .../endpoints/fal_ai/kling_video/v1_5/mod.rs | 28 + .../kling_video/v1_5/pro/effects/mod.rs | 239 ++ .../v1_5/pro/image_to_video/mod.rs | 241 ++ .../fal_ai/kling_video/v1_5/pro/mod.rs | 42 + .../kling_video/v1_5/pro/text_to_video/mod.rs | 239 ++ .../kling_video/v1_5/standard/effects/mod.rs | 239 ++ .../fal_ai/kling_video/v1_5/standard/mod.rs | 14 + .../endpoints/fal_ai/kling_video/v1_6/mod.rs | 28 + .../kling_video/v1_6/pro/effects/mod.rs | 239 ++ .../v1_6/pro/image_to_video/mod.rs | 241 ++ .../fal_ai/kling_video/v1_6/pro/mod.rs | 42 + .../kling_video/v1_6/pro/text_to_video/mod.rs | 239 ++ .../kling_video/v1_6/standard/effects/mod.rs | 239 ++ .../v1_6/standard/image_to_video/mod.rs | 239 ++ .../fal_ai/kling_video/v1_6/standard/mod.rs | 42 + .../v1_6/standard/text_to_video/mod.rs | 239 ++ .../fal_ai/kokoro/american_english/mod.rs | 186 ++ .../fal_ai/kokoro/brazilian_portuguese/mod.rs | 188 ++ .../fal_ai/kokoro/british_english/mod.rs | 186 ++ .../src/endpoints/fal_ai/kokoro/french/mod.rs | 186 ++ .../src/endpoints/fal_ai/kokoro/hindi/mod.rs | 186 ++ .../endpoints/fal_ai/kokoro/italian/mod.rs | 186 ++ .../endpoints/fal_ai/kokoro/japanese/mod.rs | 186 ++ .../fal_ai/kokoro/mandarin_chinese/mod.rs | 186 ++ .../fal-rs/src/endpoints/fal_ai/kokoro/mod.rs | 313 +++ .../endpoints/fal_ai/kokoro/spanish/mod.rs | 186 ++ .../fal_ai/kolors/image_to_image/mod.rs | 186 ++ .../fal-rs/src/endpoints/fal_ai/kolors/mod.rs | 201 ++ .../src/endpoints/fal_ai/latentsync/mod.rs | 115 + .../endpoints/fal_ai/layer_diffusion/mod.rs | 96 + .../fal-rs/src/endpoints/fal_ai/lcm/mod.rs | 208 ++ .../src/endpoints/fal_ai/lcm_sd15_i2i/mod.rs | 117 + .../fal-rs/src/endpoints/fal_ai/leffa/mod.rs | 28 + .../fal_ai/leffa/pose_transfer/mod.rs | 146 + .../fal_ai/leffa/virtual_tryon/mod.rs | 144 + .../lightning_models/image_to_image/mod.rs | 307 +++ .../fal_ai/lightning_models/inpainting/mod.rs | 307 +++ .../endpoints/fal_ai/lightning_models/mod.rs | 336 +++ .../fal_ai/live_portrait/image/mod.rs | 272 ++ .../src/endpoints/fal_ai/live_portrait/mod.rs | 301 +++ .../fal_ai/live_portrait/video/mod.rs | 272 ++ .../src/endpoints/fal_ai/llava_next/mod.rs | 58 + .../src/endpoints/fal_ai/llavav15_13b/mod.rs | 57 + .../fal_ai/lora/image_to_image/mod.rs | 673 +++++ .../src/endpoints/fal_ai/lora/inpaint/mod.rs | 671 +++++ .../fal-rs/src/endpoints/fal_ai/lora/mod.rs | 700 +++++ .../fal_ai/ltx_video/image_to_video/mod.rs | 120 + .../src/endpoints/fal_ai/ltx_video/mod.rs | 135 + .../fal_ai/ltx_video_v095/extend/mod.rs | 217 ++ .../ltx_video_v095/image_to_video/mod.rs | 219 ++ .../endpoints/fal_ai/ltx_video_v095/mod.rs | 260 ++ .../ltx_video_v095/multiconditioning/mod.rs | 219 ++ .../luma_dream_machine/image_to_video/mod.rs | 148 ++ .../fal_ai/luma_dream_machine/mod.rs | 191 ++ .../ray_2/image_to_video/mod.rs | 156 ++ .../fal_ai/luma_dream_machine/ray_2/mod.rs | 169 ++ .../ray_2_flash/image_to_video/mod.rs | 159 ++ .../luma_dream_machine/ray_2_flash/mod.rs | 171 ++ .../endpoints/fal_ai/luma_photon/flash/mod.rs | 63 + .../src/endpoints/fal_ai/luma_photon/mod.rs | 78 + .../src/endpoints/fal_ai/lumina_image/mod.rs | 14 + .../endpoints/fal_ai/lumina_image/v2/mod.rs | 156 ++ .../src/endpoints/fal_ai/mini_cpm/mod.rs | 72 + .../endpoints/fal_ai/mini_cpm/video/mod.rs | 55 + .../fal_ai/minimax/image_to_video/mod.rs | 151 ++ .../src/endpoints/fal_ai/minimax/mod.rs | 222 ++ .../minimax/video_01/image_to_video/mod.rs | 155 ++ .../endpoints/fal_ai/minimax/video_01/mod.rs | 170 ++ .../video_01_director/image_to_video/mod.rs | 157 ++ .../fal_ai/minimax/video_01_director/mod.rs | 172 ++ .../video_01_live/image_to_video/mod.rs | 162 ++ .../fal_ai/minimax/video_01_live/mod.rs | 177 ++ .../minimax/video_01_subject_reference/mod.rs | 157 ++ .../src/endpoints/fal_ai/minimax_image/mod.rs | 76 + .../src/endpoints/fal_ai/minimax_music/mod.rs | 88 + .../endpoints/fal_ai/mix_dehaze_net/mod.rs | 77 + .../src/endpoints/fal_ai/mmaudio_v2/mod.rs | 160 ++ .../fal_ai/mmaudio_v2/text_to_audio/mod.rs | 145 + .../src/endpoints/fal_ai/mochi_v1/mod.rs | 73 + .../vendor/fal-rs/src/endpoints/fal_ai/mod.rs | 2352 +++++++++++++++++ .../endpoints/fal_ai/moondream/batched/mod.rs | 84 + .../src/endpoints/fal_ai/moondream/mod.rs | 14 + .../fal_ai/moondream_next/batch/mod.rs | 144 + .../fal_ai/moondream_next/detection/mod.rs | 144 + .../endpoints/fal_ai/moondream_next/mod.rs | 173 ++ .../src/endpoints/fal_ai/musetalk/mod.rs | 65 + .../src/endpoints/fal_ai/nafnet/deblur/mod.rs | 91 + .../endpoints/fal_ai/nafnet/denoise/mod.rs | 91 + .../fal-rs/src/endpoints/fal_ai/nafnet/mod.rs | 28 + .../src/endpoints/fal_ai/omni_zero/mod.rs | 123 + .../src/endpoints/fal_ai/omnigen_v1/mod.rs | 131 + .../src/endpoints/fal_ai/photomaker/mod.rs | 106 + .../fal-rs/src/endpoints/fal_ai/pika/mod.rs | 56 + .../src/endpoints/fal_ai/pika/v1_5/mod.rs | 14 + .../fal_ai/pika/v1_5/pikaffects/mod.rs | 295 +++ .../src/endpoints/fal_ai/pika/v2/mod.rs | 42 + .../fal_ai/pika/v2/pikadditions/mod.rs | 296 +++ .../endpoints/fal_ai/pika/v2/pikaswaps/mod.rs | 294 +++ .../pika/v2/turbo/collection_to_video/mod.rs | 295 +++ .../pika/v2/turbo/image_to_video/mod.rs | 293 ++ .../src/endpoints/fal_ai/pika/v2/turbo/mod.rs | 42 + .../fal_ai/pika/v2/turbo/text_to_video/mod.rs | 293 ++ .../pika/v2_1/collection_to_video/mod.rs | 295 +++ .../fal_ai/pika/v2_1/image_to_video/mod.rs | 295 +++ .../src/endpoints/fal_ai/pika/v2_1/mod.rs | 42 + .../fal_ai/pika/v2_1/text_to_video/mod.rs | 295 +++ .../fal_ai/pika/v2_2/image_to_video/mod.rs | 296 +++ .../src/endpoints/fal_ai/pika/v2_2/mod.rs | 42 + .../fal_ai/pika/v2_2/pikascenes/mod.rs | 296 +++ .../fal_ai/pika/v2_2/text_to_video/mod.rs | 296 +++ .../src/endpoints/fal_ai/pixart_sigma/mod.rs | 161 ++ .../src/endpoints/fal_ai/pixverse/mod.rs | 14 + .../pixverse/v3_5/image_to_video/fast/mod.rs | 163 ++ .../pixverse/v3_5/image_to_video/mod.rs | 178 ++ .../src/endpoints/fal_ai/pixverse/v3_5/mod.rs | 28 + .../pixverse/v3_5/text_to_video/fast/mod.rs | 163 ++ .../fal_ai/pixverse/v3_5/text_to_video/mod.rs | 178 ++ .../fal_ai/playai/create_voice/mod.rs | 292 ++ .../fal-rs/src/endpoints/fal_ai/playai/mod.rs | 28 + .../fal_ai/playai/train/dialog/mod.rs | 292 ++ .../src/endpoints/fal_ai/playai/train/mod.rs | 14 + .../playground_v25/image_to_image/mod.rs | 275 ++ .../fal_ai/playground_v25/inpainting/mod.rs | 275 ++ .../endpoints/fal_ai/playground_v25/mod.rs | 304 +++ .../endpoints/fal_ai/post_processing/mod.rs | 230 ++ .../fal-rs/src/endpoints/fal_ai/pulid/mod.rs | 137 + .../realistic_vision/image_to_image/mod.rs | 294 +++ .../fal_ai/realistic_vision/inpainting/mod.rs | 294 +++ .../endpoints/fal_ai/realistic_vision/mod.rs | 323 +++ .../src/endpoints/fal_ai/recraft_20b/mod.rs | 117 + .../fal_ai/recraft_clarity_upscale/mod.rs | 79 + .../fal_ai/recraft_creative_upscale/mod.rs | 79 + .../fal_ai/recraft_v3/create_style/mod.rs | 130 + .../src/endpoints/fal_ai/recraft_v3/mod.rs | 145 + .../src/endpoints/fal_ai/retoucher/mod.rs | 73 + .../endpoints/fal_ai/sa2va/4b/image/mod.rs | 32 + .../src/endpoints/fal_ai/sa2va/4b/mod.rs | 2 + .../endpoints/fal_ai/sa2va/4b/video/mod.rs | 32 + .../endpoints/fal_ai/sa2va/8b/image/mod.rs | 32 + .../src/endpoints/fal_ai/sa2va/8b/mod.rs | 2 + .../endpoints/fal_ai/sa2va/8b/video/mod.rs | 32 + .../fal-rs/src/endpoints/fal_ai/sa2va/mod.rs | 28 + .../endpoints/fal_ai/sa2va/v4b/image/mod.rs | 128 + .../src/endpoints/fal_ai/sa2va/v4b/mod.rs | 28 + .../endpoints/fal_ai/sa2va/v4b/video/mod.rs | 128 + .../endpoints/fal_ai/sa2va/v8b/image/mod.rs | 128 + .../src/endpoints/fal_ai/sa2va/v8b/mod.rs | 28 + .../endpoints/fal_ai/sa2va/v8b/video/mod.rs | 128 + .../src/endpoints/fal_ai/sadtalker/mod.rs | 128 + .../fal_ai/sadtalker/reference/mod.rs | 115 + .../endpoints/fal_ai/sam2/auto_segment/mod.rs | 220 ++ .../src/endpoints/fal_ai/sam2/image/mod.rs | 218 ++ .../endpoints/fal_ai/sam2/image_rle/mod.rs | 218 ++ .../fal-rs/src/endpoints/fal_ai/sam2/mod.rs | 42 + .../fal-rs/src/endpoints/fal_ai/sana/mod.rs | 132 + .../image_to_image/mod.rs | 273 ++ .../sd15_depth_controlnet/inpainting/mod.rs | 273 ++ .../fal_ai/sd15_depth_controlnet/mod.rs | 302 +++ .../image_to_image/mod.rs | 441 ++++ .../sdxl_controlnet_union/inpainting/mod.rs | 441 ++++ .../fal_ai/sdxl_controlnet_union/mod.rs | 470 ++++ .../src/endpoints/fal_ai/skyreels_i2v/mod.rs | 87 + .../src/endpoints/fal_ai/stable_audio/mod.rs | 71 + .../endpoints/fal_ai/stable_cascade/mod.rs | 189 ++ .../stable_cascade/sote_diffusion/mod.rs | 174 ++ .../image_to_image/mod.rs | 277 ++ .../stable_diffusion_v15/inpainting/mod.rs | 277 ++ .../fal_ai/stable_diffusion_v15/mod.rs | 308 +++ .../image_to_image/mod.rs | 455 ++++ .../stable_diffusion_v35_large/inpaint/mod.rs | 455 ++++ .../fal_ai/stable_diffusion_v35_large/mod.rs | 500 ++++ .../turbo/image_to_image/mod.rs | 460 ++++ .../turbo/inpaint/mod.rs | 455 ++++ .../stable_diffusion_v35_large/turbo/mod.rs | 484 ++++ .../fal_ai/stable_diffusion_v35_medium/mod.rs | 131 + .../image_to_image/mod.rs | 173 ++ .../fal_ai/stable_diffusion_v3_medium/mod.rs | 190 ++ .../src/endpoints/fal_ai/stable_video/mod.rs | 155 ++ .../fal_ai/stable_video/text_to_video/mod.rs | 140 + .../src/endpoints/fal_ai/stepfun_video/mod.rs | 75 + .../src/endpoints/fal_ai/swin2sr/mod.rs | 76 + .../src/endpoints/fal_ai/switti/512/mod.rs | 37 + .../fal-rs/src/endpoints/fal_ai/switti/mod.rs | 148 ++ .../src/endpoints/fal_ai/switti/v512/mod.rs | 133 + .../src/endpoints/fal_ai/sync_lipsync/mod.rs | 111 + .../endpoints/fal_ai/sync_lipsync/v2/mod.rs | 96 + .../src/endpoints/fal_ai/t2v_turbo/mod.rs | 106 + .../fal-rs/src/endpoints/fal_ai/thera/mod.rs | 81 + .../fal-rs/src/endpoints/fal_ai/topaz/mod.rs | 28 + .../endpoints/fal_ai/topaz/slowmotion/mod.rs | 14 + .../fal_ai/topaz/slowmotion/video/mod.rs | 154 ++ .../src/endpoints/fal_ai/topaz/upscale/mod.rs | 42 + .../fal_ai/topaz/upscale/recover_video/mod.rs | 155 ++ .../upscale/v4x_generative_upscale/mod.rs | 156 ++ .../fal_ai/topaz/upscale/video/mod.rs | 155 ++ .../src/endpoints/fal_ai/transpixar/mod.rs | 126 + .../src/endpoints/fal_ai/trellis/mod.rs | 93 + .../src/endpoints/fal_ai/triposr/mod.rs | 132 + .../endpoints/fal_ai/triposr/remeshing/mod.rs | 117 + .../fal_ai/veo2/image_to_video/mod.rs | 114 + .../fal-rs/src/endpoints/fal_ai/veo2/mod.rs | 128 + .../fal_ai/video_prompt_generator/mod.rs | 68 + .../endpoints/fal_ai/video_upscaler/mod.rs | 66 + .../fal_ai/vidu/image_to_video/mod.rs | 153 ++ .../fal-rs/src/endpoints/fal_ai/vidu/mod.rs | 56 + .../fal_ai/vidu/reference_to_video/mod.rs | 155 ++ .../fal_ai/vidu/start_end_to_video/mod.rs | 155 ++ .../fal_ai/vidu/template_to_video/mod.rs | 155 ++ .../fal-rs/src/endpoints/fal_ai/wan/mod.rs | 14 + .../src/endpoints/fal_ai/wan/v2_1/1_3b/mod.rs | 1 + .../fal_ai/wan/v2_1/1_3b/text_to_video/mod.rs | 33 + .../src/endpoints/fal_ai/wan/v2_1/mod.rs | 14 + .../endpoints/fal_ai/wan/v2_1/v1_3b/mod.rs | 14 + .../wan/v2_1/v1_3b/text_to_video/mod.rs | 100 + .../src/endpoints/fal_ai/wan_effects/mod.rs | 122 + .../src/endpoints/fal_ai/wan_i2v/mod.rs | 107 + .../src/endpoints/fal_ai/wan_i2v_lora/mod.rs | 113 + .../fal_ai/wan_pro/image_to_video/mod.rs | 89 + .../src/endpoints/fal_ai/wan_pro/mod.rs | 28 + .../fal_ai/wan_pro/text_to_video/mod.rs | 89 + .../src/endpoints/fal_ai/wan_t2v/mod.rs | 98 + .../src/endpoints/fal_ai/wan_trainer/mod.rs | 71 + .../src/endpoints/fal_ai/whisper/mod.rs | 97 + .../fal-rs/src/endpoints/fal_ai/wizper/mod.rs | 68 + .../fal_ai/workflowutils/blur_mask/mod.rs | 436 +++ .../fal_ai/workflowutils/canny/mod.rs | 436 +++ .../fal_ai/workflowutils/compare_text/mod.rs | 436 +++ .../workflowutils/composite_image/mod.rs | 438 +++ .../fal_ai/workflowutils/grow_mask/mod.rs | 436 +++ .../fal_ai/workflowutils/image_size/mod.rs | 436 +++ .../fal_ai/workflowutils/insert_text/mod.rs | 436 +++ .../fal_ai/workflowutils/insightface/mod.rs | 436 +++ .../fal_ai/workflowutils/invert_mask/mod.rs | 436 +++ .../src/endpoints/fal_ai/workflowutils/mod.rs | 224 ++ .../fal_ai/workflowutils/regex_replace/mod.rs | 436 +++ .../fal_ai/workflowutils/resize_image/mod.rs | 436 +++ .../workflowutils/resize_to_max_pixels/mod.rs | 438 +++ .../fal_ai/workflowutils/rgba_to_rgb/mod.rs | 436 +++ .../fal_ai/workflowutils/shrink_mask/mod.rs | 436 +++ .../fal_ai/workflowutils/teed/mod.rs | 436 +++ .../transparent_image_to_mask/mod.rs | 438 +++ .../fal-rs/src/endpoints/fal_ai/yue/mod.rs | 68 + .../fal-rs/src/endpoints/fal_ai/zonos/mod.rs | 65 + .../vendor/fal-rs/src/endpoints/fashn/mod.rs | 14 + .../fal-rs/src/endpoints/fashn/tryon/mod.rs | 109 + crates/vendor/fal-rs/src/endpoints/mod.rs | 394 +++ .../base/image_to_image/mod.rs | 248 ++ .../juggernaut_flux/base/mod.rs | 274 ++ .../juggernaut_flux/base/redux/mod.rs | 245 ++ .../juggernaut_flux/lightning/mod.rs | 260 ++ .../juggernaut_flux/lightning/redux/mod.rs | 245 ++ .../rundiffusion_fal/juggernaut_flux/mod.rs | 288 ++ .../juggernaut_flux/pro/image_to_image/mod.rs | 248 ++ .../juggernaut_flux/pro/mod.rs | 274 ++ .../juggernaut_flux/pro/redux/mod.rs | 245 ++ .../image_to_image/mod.rs | 238 ++ .../juggernaut_flux_lora/inpainting/mod.rs | 235 ++ .../juggernaut_flux_lora/mod.rs | 264 ++ .../src/endpoints/rundiffusion_fal/mod.rs | 42 + .../image_to_image/mod.rs | 247 ++ .../rundiffusion_photo_flux/inpainting/mod.rs | 247 ++ .../juggernaut/image_to_image/mod.rs | 247 ++ .../juggernaut/inpainting/mod.rs | 247 ++ .../rundiffusion_photo_flux/juggernaut/mod.rs | 276 ++ .../rundiffusion_photo_flux/mod.rs | 287 ++ crates/vendor/fal-rs/src/image.rs | 49 + crates/vendor/fal-rs/src/lib.rs | 58 + crates/vendor/fal-rs/src/queue.rs | 158 ++ crates/vendor/fal-rs/src/request.rs | 132 + crates/vendor/fal-rs/tests/endpoints.rs | 14 + crates/vendor/fal-rs/tests/queue.rs | 57 + crates/vendor/fal-rs/tests/send.rs | 26 + 535 files changed, 109389 insertions(+) create mode 100644 crates/vendor/fal-rs/.cursorignore create mode 100644 crates/vendor/fal-rs/.github/workflows/bump-version.yml create mode 100644 crates/vendor/fal-rs/.github/workflows/check-fmt.yml create mode 100644 crates/vendor/fal-rs/.github/workflows/check.yml create mode 100644 crates/vendor/fal-rs/.github/workflows/generate.yml create mode 100644 crates/vendor/fal-rs/.github/workflows/publish.yml create mode 100644 crates/vendor/fal-rs/.github/workflows/test.yml create mode 100644 crates/vendor/fal-rs/.gitignore create mode 100644 crates/vendor/fal-rs/.vscode/settings.json create mode 100644 crates/vendor/fal-rs/Cargo.toml create mode 100644 crates/vendor/fal-rs/LICENSE-APACHE create mode 100644 crates/vendor/fal-rs/LICENSE-MIT create mode 100644 crates/vendor/fal-rs/README.md create mode 100644 crates/vendor/fal-rs/fal-derive/Cargo.toml create mode 100644 crates/vendor/fal-rs/fal-derive/README.md create mode 100644 crates/vendor/fal-rs/fal-derive/src/lib.rs create mode 100644 crates/vendor/fal-rs/generate/Cargo.toml create mode 100644 crates/vendor/fal-rs/generate/src/fal_data.rs create mode 100644 crates/vendor/fal-rs/generate/src/helpers.rs create mode 100644 crates/vendor/fal-rs/generate/src/main.rs create mode 100644 crates/vendor/fal-rs/generate/src/module.rs create mode 100644 crates/vendor/fal-rs/generate/src/types.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/easel_ai/advanced_face_swap/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/easel_ai/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/frame_interpolation/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_sparsectrl_lcm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/vision/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/aura_flow/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/aura_sr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/auto_caption/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ben/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/remove/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/replace/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/eraser/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/expand/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/genfill/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/product_shot/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/reimagine/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/base/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/fast/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/hd/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/bria/upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/cat_vton/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ccsr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/clarity_upscaler/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/codeformer/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/video_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/cogview4/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/controlnext/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/creative_upscaler/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/csm_1b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ddcolor/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/diffrhythm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/diffusion_edge/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/docres/dewarp/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/docres/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/drct_super_resolution/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/dubbing/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/dwpose/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/audio_isolation/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/clone_voice/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/sound_effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/speech_to_text/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/multilingual_v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/turbo_v2_5/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/era_3d/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/esrgan/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/evf_sam/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/eye_correct/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/f5_tts/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/face_to_sticker/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/video_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/video_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/compose/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/metadata/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/waveform/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption_to_phrase_grounding/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/dense_region_caption/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/detailed_caption/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/more_detailed_caption/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/object_detection/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr_with_region/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/open_vocabulary_detection/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/referring_expression_segmentation/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_proposal/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_category/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_description/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_segmentation/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flowedit/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_differential_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/differential_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/rf_inversion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_depth/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fast_training/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fill/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_portrait_trainer/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/finetuned/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/new/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny_finetuned/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth_finetuned/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill_finetuned/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/outpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra_finetuned/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro_trainer/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pulid/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/flux_subject/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/image_prompt/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/inpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/upscale_or_vary/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/multi/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/video_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_img2vid_lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/video_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora_training/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/rodin/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/iclight_v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/edit/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/remix/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/edit/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/remix/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/remix/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/remix/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/illusion_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/hed/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/lineart/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/midas/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mlsd/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/pidi/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/sam/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/scribble/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/teed/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/zoe/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/fast/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/subject_reference/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/depth/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/esrgan/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/marigold_depth/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/nsfw/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/rembg/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/sam/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/inpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/invisible_watermark/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ip_adapter_face_id/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/janus/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/kolors_virtual_try_on/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/american_english/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/brazilian_portuguese/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/british_english/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/french/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/hindi/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/italian/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/japanese/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mandarin_chinese/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/spanish/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/latentsync/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/layer_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lcm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lcm_sd15_i2i/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/pose_transfer/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/virtual_tryon/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/llava_next/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/llavav15_13b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lora/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lora/inpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/extend/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/multiconditioning/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/flash/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_subject_reference/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_music/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mix_dehaze_net/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/text_to_audio/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mochi_v1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/batched/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/batch/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/detection/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/musetalk/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/deblur/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/denoise/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/omni_zero/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/omnigen_v1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/photomaker/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/pikaffects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikadditions/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikaswaps/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/collection_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/collection_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/pikascenes/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixart_sigma/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/fast/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/fast/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playai/create_voice/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playai/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/dialog/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/post_processing/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/pulid/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_20b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_clarity_upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_creative_upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/create_style/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/retoucher/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/reference/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/auto_segment/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image_rle/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sana/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/skyreels_i2v/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_audio/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/sote_diffusion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/inpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/inpaint/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_medium/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/stepfun_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/swin2sr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/switti/512/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/switti/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/switti/v512/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/v2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/t2v_turbo/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/thera/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/recover_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/v4x_generative_upscale/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/transpixar/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/trellis/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/remeshing/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/video_prompt_generator/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/video_upscaler/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/reference_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/start_end_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/template_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_effects/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v_lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/image_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/text_to_video/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_t2v/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wan_trainer/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/whisper/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/wizper/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/blur_mask/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/canny/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/compare_text/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/composite_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/grow_mask/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/image_size/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insert_text/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insightface/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/invert_mask/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/regex_replace/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_to_max_pixels/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/rgba_to_rgb/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/shrink_mask/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/teed/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/transparent_image_to_mask/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/yue/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fal_ai/zonos/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fashn/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/fashn/tryon/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/redux/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/image_to_image/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/inpainting/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/mod.rs create mode 100644 crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/mod.rs create mode 100644 crates/vendor/fal-rs/src/image.rs create mode 100644 crates/vendor/fal-rs/src/lib.rs create mode 100644 crates/vendor/fal-rs/src/queue.rs create mode 100644 crates/vendor/fal-rs/src/request.rs create mode 100644 crates/vendor/fal-rs/tests/endpoints.rs create mode 100644 crates/vendor/fal-rs/tests/queue.rs create mode 100644 crates/vendor/fal-rs/tests/send.rs diff --git a/crates/vendor/fal-rs/.cursorignore b/crates/vendor/fal-rs/.cursorignore new file mode 100644 index 0000000000..27d59f93fc --- /dev/null +++ b/crates/vendor/fal-rs/.cursorignore @@ -0,0 +1 @@ +src/endpoints \ No newline at end of file diff --git a/crates/vendor/fal-rs/.github/workflows/bump-version.yml b/crates/vendor/fal-rs/.github/workflows/bump-version.yml new file mode 100644 index 0000000000..b4583d40c3 --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/bump-version.yml @@ -0,0 +1,68 @@ +name: Bump Version + +on: + workflow_dispatch: + inputs: + version_type: + description: "Version bump type (major, minor, patch)" + required: true + default: "patch" + type: choice + options: + - major + - minor + - patch + +env: + CARGO_TERM_COLOR: always + +jobs: + bump-version: + name: Bump Version + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + ref: main + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create branch + run: | + branch_name="bump/version-$(date +%Y%m%d-%H%M%S)" + git checkout -b $branch_name + echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV + + - name: Bump version + run: | + cargo install cargo-bump + cargo bump ${{ inputs.version_type }} + + - name: Commit changes + run: | + git add . + git commit -m "chore: bump version (${{ inputs.version_type }})" + git push origin ${{ env.BRANCH_NAME }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "chore: bump version (${{ inputs.version_type }})" + body: | + This PR was automatically created by the Bump Version workflow. + + - Bumps version (${{ inputs.version_type }}) + branch: ${{ env.BRANCH_NAME }} + base: main diff --git a/crates/vendor/fal-rs/.github/workflows/check-fmt.yml b/crates/vendor/fal-rs/.github/workflows/check-fmt.yml new file mode 100644 index 0000000000..0f11045f9e --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/check-fmt.yml @@ -0,0 +1,28 @@ +name: cargo fmt + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Run cargo test + env: + FAL_API_KEY: ${{ secrets.FAL_API_KEY }} + run: cargo fmt --all --check diff --git a/crates/vendor/fal-rs/.github/workflows/check.yml b/crates/vendor/fal-rs/.github/workflows/check.yml new file mode 100644 index 0000000000..986b8a1a71 --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/check.yml @@ -0,0 +1,26 @@ +name: cargo check + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Run cargo check + run: cargo check --all-features --workspace diff --git a/crates/vendor/fal-rs/.github/workflows/generate.yml b/crates/vendor/fal-rs/.github/workflows/generate.yml new file mode 100644 index 0000000000..e995e70578 --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/generate.yml @@ -0,0 +1,49 @@ +name: Generate Endpoints + +on: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + generate: + name: Generate Endpoints + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Generate endpoints + run: cargo run -p generate-endpoints + + - name: cargo fmt + run: cargo fmt + + - name: Check for changes + id: git-check + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "changes=true" >> $GITHUB_OUTPUT + else + echo "changes=false" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + if: steps.git-check.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "chore: update generated endpoints" + title: Update Endpoints + body: Automated update of generated endpoints + branch: update-endpoints diff --git a/crates/vendor/fal-rs/.github/workflows/publish.yml b/crates/vendor/fal-rs/.github/workflows/publish.yml new file mode 100644 index 0000000000..4b54d3e113 --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/publish.yml @@ -0,0 +1,70 @@ +name: Publish to crates.io + +on: + workflow_dispatch: + inputs: + version_bump: + description: "Version bump type (major, minor, patch)" + required: false + default: "patch" + type: choice + options: + - major + - minor + - patch + +env: + CARGO_TERM_COLOR: always + +jobs: + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Install cargo-bump + run: cargo install cargo-bump + + - name: Bump version + run: | + cargo bump ${{ github.event.inputs.version_bump }} + version=$(cargo pkgid | cut -d# -f2 | cut -d: -f2) + echo "NEW_VERSION=$version" >> $GITHUB_ENV + # Extract major.minor version for README updates + major_minor=$(echo $version | cut -d. -f1,2) + echo "MAJOR_MINOR=$major_minor" >> $GITHUB_ENV + + - name: Update README versions + run: | + # Use perl for in-place replacement of version strings in README + perl -i -pe 's/fal = "[\d\.]+"/fal = "${{ env.MAJOR_MINOR }}"/' README.md + perl -i -pe 's/fal = \{ version = "[\d\.]+"/fal = { version = "${{ env.MAJOR_MINOR }}"/' README.md + + - name: Publish to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo publish -p fal + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Commit and push changes + run: | + git add . + git commit -m "chore: bump version to ${{ env.NEW_VERSION }}" + git tag "v${{ env.NEW_VERSION }}" + git push origin main + git push origin "v${{ env.NEW_VERSION }}" + + - name: Create Github Release + uses: softprops/action-gh-release@v2 diff --git a/crates/vendor/fal-rs/.github/workflows/test.yml b/crates/vendor/fal-rs/.github/workflows/test.yml new file mode 100644 index 0000000000..59877c02a3 --- /dev/null +++ b/crates/vendor/fal-rs/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: cargo test + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Run cargo test + env: + FAL_API_KEY: ${{ secrets.FAL_API_KEY }} + run: cargo test --all-features --workspace diff --git a/crates/vendor/fal-rs/.gitignore b/crates/vendor/fal-rs/.gitignore new file mode 100644 index 0000000000..87e808e98d --- /dev/null +++ b/crates/vendor/fal-rs/.gitignore @@ -0,0 +1,10 @@ +/target +examples/*/target +examples/*/Cargo.lock +.fastembed_cache +/backup.sql +.env* + +.DS_Store + +Cargo.lock \ No newline at end of file diff --git a/crates/vendor/fal-rs/.vscode/settings.json b/crates/vendor/fal-rs/.vscode/settings.json new file mode 100644 index 0000000000..0571da87e5 --- /dev/null +++ b/crates/vendor/fal-rs/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "rust-analyzer.cargo.features": [] +} \ No newline at end of file diff --git a/crates/vendor/fal-rs/Cargo.toml b/crates/vendor/fal-rs/Cargo.toml new file mode 100644 index 0000000000..e608f8031f --- /dev/null +++ b/crates/vendor/fal-rs/Cargo.toml @@ -0,0 +1,280 @@ +[package] +name = "fal" +edition = "2021" +version = "0.3.6" +authors = ["Carlos Diaz-Padron"] +description = "A Rust crate for the fal.ai API, including generated, typed functions for all public models" +keywords = [ + "fal", + "ai", + "generative-ai", +] +categories = ["api-bindings"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/carlosdp/fal-rs" + +[package.metadata.docs.rs] +all-features = true + +[workspace] +members = [ + "fal-derive", + "generate", +] +resolver = "2" + +[workspace.dependencies] +reqwest = "0.12" +serde = "1" +serde_json = "1" +tokio = "1" + +[dependencies] +eventsource-stream = "0.2" +smart-default = "0.7" +thiserror = "1" + +[dependencies.base64] +version = "0.22" +optional = true + +[dependencies.fal-derive] +version = "0.1" +path = "./fal-derive" + +[dependencies.futures] +version = "0.3" +optional = true + +[dependencies.image] +version = "0.25" +optional = true + +[dependencies.reqwest] +workspace = true +features = [ + "json", + "stream", +] + +[dependencies.serde] +workspace = true +features = ["derive"] + +[dependencies.serde_json] +workspace = true + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[features] +default = ["image"] +endpoints = [] +endpoints_easel-ai = [] +endpoints_easel-ai_advanced-face-swap = [] +endpoints_fal-ai = [] +endpoints_fal-ai_amt-interpolation = [] +endpoints_fal-ai_animatediff-sparsectrl-lcm = [] +endpoints_fal-ai_animatediff-v2v = [] +endpoints_fal-ai_any-llm = [] +endpoints_fal-ai_aura-flow = [] +endpoints_fal-ai_aura-sr = [] +endpoints_fal-ai_auto-caption = [] +endpoints_fal-ai_ben = [] +endpoints_fal-ai_birefnet = [] +endpoints_fal-ai_bria = [] +endpoints_fal-ai_cat-vton = [] +endpoints_fal-ai_ccsr = [] +endpoints_fal-ai_clarity-upscaler = [] +endpoints_fal-ai_codeformer = [] +endpoints_fal-ai_cogvideox-5b = [] +endpoints_fal-ai_cogview4 = [] +endpoints_fal-ai_controlnext = [] +endpoints_fal-ai_creative-upscaler = [] +endpoints_fal-ai_csm-1b = [] +endpoints_fal-ai_ddcolor = [] +endpoints_fal-ai_diffrhythm = [] +endpoints_fal-ai_diffusion-edge = [] +endpoints_fal-ai_docres = [] +endpoints_fal-ai_drct-super-resolution = [] +endpoints_fal-ai_dreamshaper = [] +endpoints_fal-ai_dubbing = [] +endpoints_fal-ai_dwpose = [] +endpoints_fal-ai_elevenlabs = [] +endpoints_fal-ai_era-3d = [] +endpoints_fal-ai_esrgan = [] +endpoints_fal-ai_evf-sam = [] +endpoints_fal-ai_eye-correct = [] +endpoints_fal-ai_f5-tts = [] +endpoints_fal-ai_face-to-sticker = [] +endpoints_fal-ai_fast-animatediff = [] +endpoints_fal-ai_fast-fooocus-sdxl = [] +endpoints_fal-ai_fast-lcm-diffusion = [] +endpoints_fal-ai_fast-lightning-sdxl = [] +endpoints_fal-ai_fast-sdxl = [] +endpoints_fal-ai_fast-sdxl-controlnet-canny = [] +endpoints_fal-ai_fast-svd = [] +endpoints_fal-ai_fast-svd-lcm = [] +endpoints_fal-ai_fast-turbo-diffusion = [] +endpoints_fal-ai_ffmpeg-api = [] +endpoints_fal-ai_florence-2-large = [] +endpoints_fal-ai_flowedit = [] +endpoints_fal-ai_flux = [] +endpoints_fal-ai_flux-control-lora-canny = [] +endpoints_fal-ai_flux-control-lora-depth = [] +endpoints_fal-ai_flux-differential-diffusion = [] +endpoints_fal-ai_flux-general = [] +endpoints_fal-ai_flux-lora = [] +endpoints_fal-ai_flux-lora-canny = [] +endpoints_fal-ai_flux-lora-depth = [] +endpoints_fal-ai_flux-lora-fast-training = [] +endpoints_fal-ai_flux-lora-fill = [] +endpoints_fal-ai_flux-lora-portrait-trainer = [] +endpoints_fal-ai_flux-pro = [] +endpoints_fal-ai_flux-pro-trainer = [] +endpoints_fal-ai_flux-pulid = [] +endpoints_fal-ai_flux-subject = [] +endpoints_fal-ai_fooocus = [] +endpoints_fal-ai_gemini-flash-edit = [] +endpoints_fal-ai_got-ocr = [] +endpoints_fal-ai_hunyuan-video = [] +endpoints_fal-ai_hunyuan-video-image-to-video = [] +endpoints_fal-ai_hunyuan-video-img2vid-lora = [] +endpoints_fal-ai_hunyuan-video-lora = [] +endpoints_fal-ai_hunyuan-video-lora-training = [] +endpoints_fal-ai_hunyuan3d = [] +endpoints_fal-ai_hyper-sdxl = [] +endpoints_fal-ai_hyper3d = [] +endpoints_fal-ai_iclight-v2 = [] +endpoints_fal-ai_ideogram = [] +endpoints_fal-ai_illusion-diffusion = [] +endpoints_fal-ai_image-preprocessors = [] +endpoints_fal-ai_imagen3 = [] +endpoints_fal-ai_imageutils = [] +endpoints_fal-ai_inpaint = [] +endpoints_fal-ai_invisible-watermark = [] +endpoints_fal-ai_ip-adapter-face-id = [] +endpoints_fal-ai_janus = [] +endpoints_fal-ai_kling = [] +endpoints_fal-ai_kling-video = [] +endpoints_fal-ai_kokoro = [] +endpoints_fal-ai_kolors = [] +endpoints_fal-ai_latentsync = [] +endpoints_fal-ai_layer-diffusion = [] +endpoints_fal-ai_lcm = [] +endpoints_fal-ai_lcm-sd15-i2i = [] +endpoints_fal-ai_leffa = [] +endpoints_fal-ai_lightning-models = [] +endpoints_fal-ai_live-portrait = [] +endpoints_fal-ai_llava-next = [] +endpoints_fal-ai_llavav15-13b = [] +endpoints_fal-ai_lora = [] +endpoints_fal-ai_ltx-video = [] +endpoints_fal-ai_ltx-video-v095 = [] +endpoints_fal-ai_luma-dream-machine = [] +endpoints_fal-ai_luma-photon = [] +endpoints_fal-ai_lumina-image = [] +endpoints_fal-ai_mini-cpm = [] +endpoints_fal-ai_minimax = [] +endpoints_fal-ai_minimax-image = [] +endpoints_fal-ai_minimax-music = [] +endpoints_fal-ai_mix-dehaze-net = [] +endpoints_fal-ai_mmaudio-v2 = [] +endpoints_fal-ai_mochi-v1 = [] +endpoints_fal-ai_moondream = [] +endpoints_fal-ai_moondream-next = [] +endpoints_fal-ai_musetalk = [] +endpoints_fal-ai_nafnet = [] +endpoints_fal-ai_omni-zero = [] +endpoints_fal-ai_omnigen-v1 = [] +endpoints_fal-ai_photomaker = [] +endpoints_fal-ai_pika = [] +endpoints_fal-ai_pixart-sigma = [] +endpoints_fal-ai_pixverse = [] +endpoints_fal-ai_playai = [] +endpoints_fal-ai_playground-v25 = [] +endpoints_fal-ai_post-processing = [] +endpoints_fal-ai_pulid = [] +endpoints_fal-ai_realistic-vision = [] +endpoints_fal-ai_recraft-20b = [] +endpoints_fal-ai_recraft-clarity-upscale = [] +endpoints_fal-ai_recraft-creative-upscale = [] +endpoints_fal-ai_recraft-v3 = [] +endpoints_fal-ai_retoucher = [] +endpoints_fal-ai_sa2va = [] +endpoints_fal-ai_sadtalker = [] +endpoints_fal-ai_sam2 = [] +endpoints_fal-ai_sana = [] +endpoints_fal-ai_sd15-depth-controlnet = [] +endpoints_fal-ai_sdxl-controlnet-union = [] +endpoints_fal-ai_skyreels-i2v = [] +endpoints_fal-ai_stable-audio = [] +endpoints_fal-ai_stable-cascade = [] +endpoints_fal-ai_stable-diffusion-v15 = [] +endpoints_fal-ai_stable-diffusion-v3-medium = [] +endpoints_fal-ai_stable-diffusion-v35-large = [] +endpoints_fal-ai_stable-diffusion-v35-medium = [] +endpoints_fal-ai_stable-video = [] +endpoints_fal-ai_stepfun-video = [] +endpoints_fal-ai_swin2sr = [] +endpoints_fal-ai_switti = [] +endpoints_fal-ai_sync-lipsync = [] +endpoints_fal-ai_t2v-turbo = [] +endpoints_fal-ai_thera = [] +endpoints_fal-ai_topaz = [] +endpoints_fal-ai_transpixar = [] +endpoints_fal-ai_trellis = [] +endpoints_fal-ai_triposr = [] +endpoints_fal-ai_veo2 = [] +endpoints_fal-ai_video-prompt-generator = [] +endpoints_fal-ai_video-upscaler = [] +endpoints_fal-ai_vidu = [] +endpoints_fal-ai_wan = [] +endpoints_fal-ai_wan-effects = [] +endpoints_fal-ai_wan-i2v = [] +endpoints_fal-ai_wan-i2v-lora = [] +endpoints_fal-ai_wan-pro = [] +endpoints_fal-ai_wan-t2v = [] +endpoints_fal-ai_wan-trainer = [] +endpoints_fal-ai_whisper = [] +endpoints_fal-ai_wizper = [] +endpoints_fal-ai_workflowutils = [] +endpoints_fal-ai_yue = [] +endpoints_fal-ai_zonos = [] +endpoints_fashn = [] +endpoints_fashn_tryon = [] +endpoints_rundiffusion-fal = [] +endpoints_rundiffusion-fal_juggernaut-flux = [] +endpoints_rundiffusion-fal_juggernaut-flux-lora = [] +endpoints_rundiffusion-fal_rundiffusion-photo-flux = [] +image = [ + "dep:image", + "futures", + "base64", +] + +[[test]] +path = "tests/endpoints.rs" +name = "endpoints" +edition = "2021" +required-features = ["endpoints_fal-ai_flux"] + +[[test]] +path = "tests/queue.rs" +name = "queue" +edition = "2021" +required-features = [] + +[[test]] +path = "tests/send.rs" +name = "send" +edition = "2021" +required-features = [] + +[lib] +path = "src/lib.rs" +name = "fal" +edition = "2021" +required-features = [] +crate-type = ["lib"] diff --git a/crates/vendor/fal-rs/LICENSE-APACHE b/crates/vendor/fal-rs/LICENSE-APACHE new file mode 100644 index 0000000000..b1121cb191 --- /dev/null +++ b/crates/vendor/fal-rs/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/crates/vendor/fal-rs/LICENSE-MIT b/crates/vendor/fal-rs/LICENSE-MIT new file mode 100644 index 0000000000..63b4b681cb --- /dev/null +++ b/crates/vendor/fal-rs/LICENSE-MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [year] [fullname] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/crates/vendor/fal-rs/README.md b/crates/vendor/fal-rs/README.md new file mode 100644 index 0000000000..b8ff767135 --- /dev/null +++ b/crates/vendor/fal-rs/README.md @@ -0,0 +1,178 @@ +# fal-rs + +[![Crates.io](https://img.shields.io/crates/v/fal.svg)](https://crates.io/crates/fal) +[![Documentation](https://docs.rs/fal/badge.svg)](https://docs.rs/fal) +[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT) + +A Rust client for the [fal.ai](https://fal.ai) API, providing easy access to state-of-the-art AI models for image generation, audio processing, and more. + +## Features + +- **Type-safe API**: Strongly typed interfaces for all fal.ai endpoints, generated and kept up-to-date straight from the API itself +- **Compile Time Efficient**: FAL API Endpoint modules are code generated from the API with granular features, so you only build the set of endpoints you actually use! +- **Async/Await Support**: Built on top of `reqwest` for efficient async operations +- **Queue System**: Built-in support for fal.ai's queue system for long-running operations + +## Installation + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +fal = "0.3" +``` + +## Usage +### Using public model endpoints + +By default, endpoints are disabled. The FAL API has hundreds of endpoints, and are growing in number by the day. In order to prevent compile time and binary size bloat, this crate supports somewhat fine-grained crate features for enabling endpoints, as you need them. To use pre-built, fully-typed endpoint functions to call the API, you can enable them by enabling the corresponding feature for that group of endpoints. For example, for the `fal-ai/flux/dev` endpoint, I can enable it like this: + +```toml +# In Cargo.toml +fal = { version = "0.3", features = ["endpoints_fal-ai_flux"] } +``` + +**Note**: The features go a maximum of two "levels", so you can enable `fal-ai/flux`, which enables all endpoints under `fal-ai/flux`, or `fal-ai`, or all endpoints in the API. + +or, I can enable *all* endpoints under the `fal-ai` owner: + +```toml +# In Cargo.toml +fal = { version = "0.3", features = ["endpoints_fal-ai"] } +``` + +or if I'm really crazy, I can just enable all endpoints in the API: + +```toml +# In Cargo.toml +fal = { version = "0.3", features = ["endpoints"] } +``` + +Once enabled, the endpoint can be called like this: + +```rust,no_run +use fal::prelude::*; +use fal::endpoints::fal_ai::flux; + +#[tokio::main] +async fn main() { + let api_key = std::env::var("FAL_API_KEY").unwrap(); + + // Use the Flux Dev endpoint to generate an image + let response = flux::dev::dev(flux::dev::DevTextToImageInput { + prompt: "a majestic horse in a field".to_string(), + ..Default::default() + }) + .with_api_key(api_key) // If not provided, the FAL_API_KEY environment variable is used + .send() + .await + .unwrap(); + + println!("Generated image URL: {}", response.images[0].url); +} +``` + +### Using the Queue System + +For long-running operations, you can use the [FAL Queue API](https://docs.fal.ai/model-endpoints/queue): + +```rust,no_run +use fal::prelude::*; +use fal::endpoints::fal_ai::flux; +use futures::StreamExt; + +#[tokio::main] +async fn main() { + let queue = flux::dev::dev(flux::dev::DevTextToImageInput { + prompt: "a majestic horse in a field".to_string(), + ..Default::default() + }) + .queue() + .await + .unwrap(); + + // Stream status updates + while let Some(status) = queue.stream(true).await.unwrap().next().await { + let status = status.unwrap(); + println!("Status: {:?}", status.status); + + if status.status == Status::Completed { + break; + } + } + + let response = queue.response().await.unwrap(); + println!("Generated image URL: {}", response.images[0].url); +} +``` + +### The `#[endpoint]` macro +You can easily create a custom endpoint function using the provided [endpoint](crate::endpoint) proc macro. This should only be necessary if you are using a private model endpoint, or you really just want control over your types. Otherwise, you should be able to find the endpoint you want to use in the pre-built endpoints module! + +```rust,no_run +use fal::prelude::*; +use serde::Deserialize; + +#[derive(Debug, Deserialize)] +pub struct File { + pub url: String, + pub content_type: String, + pub file_name: Option, + pub file_size: Option, + pub width: Option, + pub height: Option, +} + +#[derive(Deserialize)] +pub struct FalResponse { + pub images: Vec, +} + +#[endpoint(endpoint="fal-ai/flux/dev")] +pub fn flux_dev(prompt: String) -> FalResponse {} + +// This endpoint function can now be used to call the fal endpoint: +#[tokio::main] +async fn main() { + let response = flux_dev("an horse riding an astronaut".to_owned()) + .send() + .await + .unwrap(); + + println!("Generated image URL: {}", response.images[0].url); +} +``` + +## Features + +The crate comes with several optional features: + +- `endpoints_*`: Include pre-generated endpoint modules for fal.ai services. See "Using public model endpoints" above for details. + +## Generating Endpoint Modules + +The `generate` package in this repository is used to automatically generate endpoint modules based on the fal.ai API specification. This ensures that the client always has up-to-date type definitions and endpoint implementations. + +To generate endpoint modules: + +1. Clone the repository +2. Run the generate package: + +```bash +cargo run -p generate-endpoints +``` + +This will update the endpoint modules in the `fal/src/endpoints` directory with the latest API definitions, using the model registry from the FAL API. + +## License + +Licensed under either of: + + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +## Contributing + +We welcome contributions! Please feel free to submit a Pull Request. diff --git a/crates/vendor/fal-rs/fal-derive/Cargo.toml b/crates/vendor/fal-rs/fal-derive/Cargo.toml new file mode 100644 index 0000000000..6ffef6ea9d --- /dev/null +++ b/crates/vendor/fal-rs/fal-derive/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "fal-derive" +description = "Macros for creating fal API endpoint functions" +version = "0.1.0" +edition = "2021" +repository = "https://github.com/carlosdp/fal-rs" +license = "MIT OR Apache-2.0" +keywords = ["fal", "ai", "generative-ai"] +authors = ["Carlos Diaz-Padron"] + +[lib] +proc-macro = true + +[dependencies] +syn = { version = "2.0", features = ["full"] } +quote = "1.0" +proc-macro2 = "1.0" \ No newline at end of file diff --git a/crates/vendor/fal-rs/fal-derive/README.md b/crates/vendor/fal-rs/fal-derive/README.md new file mode 100644 index 0000000000..0cd3d08ef1 --- /dev/null +++ b/crates/vendor/fal-rs/fal-derive/README.md @@ -0,0 +1,25 @@ +Creates a custom endpoint function, compatible with the fal API. + +```rust,ignore +use fal::prelude::*; +use serde::Deserialize; + +#[derive(Deserialize)] +pub struct FalResponse { + pub images: Vec, +} + +#[endpoint(endpoint="fal-ai/flux/dev")] +pub fn flux_dev(prompt: String) -> FalResponse {} + +// This endpoint function can now be used to call the fal endpoint: +#[tokio::main] +async fn main() { + let response = flux_dev("an horse riding an astronaut".to_owned()) + .send() + .await + .unwrap(); + + println!("Generated image URL: {}", response.images[0].url); +} +``` \ No newline at end of file diff --git a/crates/vendor/fal-rs/fal-derive/src/lib.rs b/crates/vendor/fal-rs/fal-derive/src/lib.rs new file mode 100644 index 0000000000..1f4f77d9c0 --- /dev/null +++ b/crates/vendor/fal-rs/fal-derive/src/lib.rs @@ -0,0 +1,133 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{ + parse::Parse, parse::ParseStream, parse_macro_input, punctuated::Punctuated, FnArg, ItemFn, + Meta, PatType, ReturnType, Token, +}; + +enum EndpointAttr { + Path(String), + InFalCrate, +} + +impl Parse for EndpointAttr { + fn parse(input: ParseStream) -> syn::Result { + let meta: Meta = input.parse()?; + match meta { + Meta::Path(path) if path.is_ident("in_fal_crate") => Ok(EndpointAttr::InFalCrate), + Meta::NameValue(nv) if nv.path.is_ident("endpoint") => match nv.value { + syn::Expr::Lit(lit) => { + if let syn::Lit::Str(s) = lit.lit { + return Ok(EndpointAttr::Path(s.value())); + } + Err(syn::Error::new_spanned(lit, "expected string literal")) + } + _ => Err(syn::Error::new_spanned(nv.value, "expected string literal")), + }, + _ => Err(syn::Error::new_spanned( + meta, + "expected endpoint = \"...\" or in_fal_crate", + )), + } + } +} + +#[doc = include_str!("../README.md")] +#[proc_macro_attribute] +pub fn endpoint(attr: TokenStream, item: TokenStream) -> TokenStream { + let attr = + parse_macro_input!(attr with Punctuated::::parse_terminated); + let input_fn = parse_macro_input!(item as ItemFn); + + // Extract the endpoint string and in_fal_crate flag from the attributes + let mut endpoint_str = None; + let mut in_fal_crate = false; + + for attr in attr.iter() { + match attr { + EndpointAttr::Path(s) => endpoint_str = Some(s), + EndpointAttr::InFalCrate => in_fal_crate = true, + } + } + + let endpoint_str = endpoint_str.expect("endpoint attribute must be provided"); + + let fn_name = &input_fn.sig.ident; + let fn_name_str = fn_name.to_string(); + let camel_case_name = snake_to_upper_camel(&fn_name_str); + let struct_name = syn::Ident::new(&format!("{}Params", camel_case_name), fn_name.span()); + let vis = &input_fn.vis; + + // Extract function parameters + let mut param_fields = Vec::new(); + let mut param_names = Vec::new(); + + for arg in input_fn.sig.inputs.iter() { + if let FnArg::Typed(PatType { pat, ty, .. }) = arg { + if let syn::Pat::Ident(pat_ident) = *pat.clone() { + let ident = pat_ident.ident.clone(); + param_fields.push(quote! { pub #ident: #ty }); + param_names.push(pat_ident.ident); + } + } + } + + // Extract return type + let return_type = match &input_fn.sig.output { + ReturnType::Type(_, ty) => ty, + _ => panic!("Function must have a return type"), + }; + + // Choose the appropriate crate reference + let crate_ref = if in_fal_crate { + quote! { crate } + } else { + quote! { fal } + }; + + // Generate the expanded code + let struct_def = quote! { + #[derive(serde::Serialize)] + #vis struct #struct_name { + #(#param_fields),* + } + }; + + let inputs = input_fn.sig.inputs; + + let fn_def = quote! { + #vis fn #fn_name(#inputs) -> #crate_ref::request::FalRequest<#struct_name, #return_type> { + #crate_ref::request::FalRequest::new( + #endpoint_str, + #struct_name { + #(#param_names: #param_names),* + } + ) + } + }; + + let expanded = quote! { + #struct_def + #fn_def + }; + + TokenStream::from(expanded) +} + +fn snake_to_upper_camel(input: &str) -> String { + let mut result = String::new(); + let mut capitalize_next = true; + + for c in input.chars() { + if c == '_' { + capitalize_next = true; + } else if capitalize_next { + result.push(c.to_ascii_uppercase()); + capitalize_next = false; + } else { + result.push(c); + } + } + + result +} diff --git a/crates/vendor/fal-rs/generate/Cargo.toml b/crates/vendor/fal-rs/generate/Cargo.toml new file mode 100644 index 0000000000..776a0c9d8d --- /dev/null +++ b/crates/vendor/fal-rs/generate/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "generate-endpoints" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +reqwest = { workspace = true, features = ["json", "stream", "multipart"] } +tokio = { workspace = true, features = ["full"] } +serde = { workspace = true, features = ["derive"] } +serde_json.workspace = true +percent-encoding = "2.3" +tracing = "0.1.41" +tracing-subscriber = "0.3.19" +cargo-manifest = "0.19" +toml = "0.8" diff --git a/crates/vendor/fal-rs/generate/src/fal_data.rs b/crates/vendor/fal-rs/generate/src/fal_data.rs new file mode 100644 index 0000000000..f80f1a7992 --- /dev/null +++ b/crates/vendor/fal-rs/generate/src/fal_data.rs @@ -0,0 +1,47 @@ +use serde::Deserialize; + +#[derive(Debug, Deserialize)] +#[allow(dead_code)] +pub struct ModelGroup { + pub key: String, + pub label: String, +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(dead_code)] +pub struct Model { + pub id: String, + pub title: String, + pub category: String, + #[serde(default)] + pub tags: Vec, + pub short_description: String, + pub thumbnail_url: String, + pub model_url: String, + pub stream_url: Option, + pub date: String, + pub machine_type: Option, + pub license_type: Option, + pub group: Option, + #[serde(default)] + pub result_comparison: bool, + #[serde(default)] + pub highlighted: bool, + pub pricing_info_override: Option, + pub credits_required: Option, + pub endpoint_id: String, +} + +#[derive(Debug, Deserialize)] +#[allow(dead_code)] +pub struct AppDataMetadata { + pub openapi: serde_json::Value, +} + +#[derive(Debug, Deserialize)] +#[allow(dead_code)] +pub struct AppData { + pub app_name: String, + pub metadata: AppDataMetadata, +} diff --git a/crates/vendor/fal-rs/generate/src/helpers.rs b/crates/vendor/fal-rs/generate/src/helpers.rs new file mode 100644 index 0000000000..5e7dda9c6b --- /dev/null +++ b/crates/vendor/fal-rs/generate/src/helpers.rs @@ -0,0 +1,55 @@ +pub fn snake_to_upper_camel(input: &str) -> String { + let mut result = String::new(); + let mut capitalize_next = true; + + for c in input.chars() { + if c == '_' { + capitalize_next = true; + } else if capitalize_next { + result.push(c.to_ascii_uppercase()); + capitalize_next = false; + } else { + result.push(c); + } + } + + result +} + +pub fn to_snake_case(input: &str) -> String { + let mut result = String::new(); + let mut prev_is_uppercase = false; + + for (i, c) in input.chars().enumerate() { + if c.is_uppercase() { + if i > 0 && !prev_is_uppercase { + result.push('_'); + } + result.push(c.to_lowercase().next().unwrap()); + prev_is_uppercase = true; + } else { + result.push(if c.is_whitespace() || c == '-' { + '_' + } else { + c + }); + prev_is_uppercase = false; + } + } + + result +} + +pub fn is_rust_keyword(word: &str) -> bool { + const KEYWORDS: &[&str] = &[ + "as", "break", "const", "continue", "crate", "else", "enum", "extern", "false", "fn", + "for", "if", "impl", "in", "let", "loop", "match", "mod", "move", "mut", "pub", "ref", + "return", "self", "Self", "static", "struct", "super", "trait", "true", "type", "unsafe", + "use", "where", "while", // Reserved for future use + "abstract", "async", "await", "become", "box", "do", "final", "macro", "override", "priv", + "try", "typeof", "unsized", "virtual", "yield", // Strict mode keywords + "dyn", + ]; + + KEYWORDS.contains(&word) +} diff --git a/crates/vendor/fal-rs/generate/src/main.rs b/crates/vendor/fal-rs/generate/src/main.rs new file mode 100644 index 0000000000..7814db9ff7 --- /dev/null +++ b/crates/vendor/fal-rs/generate/src/main.rs @@ -0,0 +1,292 @@ +mod fal_data; +mod helpers; +mod module; +mod types; + +use fal_data::*; +use module::*; +use types::*; + +use std::collections::HashSet; + +use cargo_manifest::Manifest; +use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC}; + +#[tokio::main] +async fn main() { + tracing_subscriber::fmt::init(); + + let base_module_path = "src/endpoints"; + + let mut root = Node::Module { + name: "endpoints".to_string(), + children: Vec::new(), + }; + + let client = reqwest::Client::new(); + + let models: Vec = client + .get("https://fal.ai/api/models") + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .json() + .await + .unwrap(); + + // De-duplicate, because the /models endpoint returns multiple endpoints within an alias + let mut visited_aliases = HashSet::new(); + + for model in &models { + let (owner, endpoint) = model + .endpoint_id + .split_once("/") + .expect(&format!("could not split endpoint: {}", &model.endpoint_id)); + + // URL encode the alias to handle special characters in the endpoint + let parts = endpoint.split("/").collect::>(); + let alias = parts[0]; + + if visited_aliases.contains(alias) { + continue; + } + + visited_aliases.insert(alias); + + let encoded_alias = utf8_percent_encode(alias, NON_ALPHANUMERIC).to_string(); + + let app_data: AppData = client + .get(format!( + "https://fal.ai/api/models/app-data?owner={owner}&alias={encoded_alias}" + )) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .json() + .await + .unwrap(); + let paths = app_data.metadata.openapi["paths"].as_object().unwrap(); + + for (path, params) in paths { + if path == "/health" { + // skip healthcheck endpoint + continue; + } + + let module_parts = if path == "/" { + vec![] + } else { + path.split("/") + .skip(1) + .map(|s| s.replace(".", "_").replace("-", "_")) + .map(|s| { + if s.chars().next().unwrap().is_digit(10) { + format!("v{s}") + } else { + s.to_string() + } + }) + .collect::>() + }; + + let parent_parts = vec![ + owner.replace(".", "_").replace("-", "_"), + alias + .split("/") + .collect::>() + .join("::") + .replace(".", "_") + .replace("-", "_"), + ] + .into_iter() + .map(|s| { + if s.chars().next().unwrap().is_digit(10) { + format!("v{s}") + } else { + s.to_string() + } + }) + .collect::>(); + + let fn_name = if module_parts.is_empty() { + parent_parts + .last() + .unwrap_or(&"default".to_string()) + .to_string() + } else { + module_parts.last().unwrap().to_string() + }; + + // Combine parent and module parts for the full path + let mut full_path_parts = Vec::new(); + // Don't include the root module name since it's just the container + full_path_parts.extend(parent_parts.iter().map(String::as_str)); + full_path_parts.extend(module_parts.iter().map(String::as_str)); + + let Some(output_type_ref) = params["post"]["responses"]["200"]["content"] + ["application/json"]["schema"]["$ref"] + .as_str() + else { + tracing::error!("no output type ref for {}", &model.endpoint_id); + tracing::error!("params: {:?}", params); + continue; + }; + + let output_type = { + let Some(schema) = app_data + .metadata + .openapi + .pointer(&output_type_ref[1..]) + .clone() + else { + tracing::error!("no schema found for {}, skipping endpoint", output_type_ref); + continue; + }; + schema.clone() + }; + let input_types = app_data.metadata.openapi["components"]["schemas"] + .as_object() + .unwrap() + .iter() + .map(|(_, schema)| schema.clone()) + .collect::>(); + + let docs = docs_from(&model, params); + + let endpoint = format!("{owner}/{alias}{}", if path == "/" { "" } else { path }); + + // Insert into the tree + root.insert_path( + &full_path_parts, + &endpoint, + &fn_name, + params["post"].clone(), + input_types, + output_type, + docs, + ); + } + + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + + // Print the tree structure + root.print_tree(0); + + // Write the module tree to files + write_module_to_files(&root, base_module_path, true).expect("Failed to write module files"); + + let mut manifest = Manifest::from_path("Cargo.toml").unwrap(); + + // Write initial root mod.rs with module declarations + let root_mod_content = match &root { + Node::Module { children, .. } => children + .iter() + .filter_map(|child| { + if let Node::Module { name, children } = child { + // Collect all child features recursively + let mut all_features = vec![format!("endpoints_{}", name.replace("_", "-"))]; + + // Helper function to collect child features + fn collect_child_features(node: &Node, features: &mut Vec, parent_name: &str) { + if let Node::Module { name, children } = node { + let current_name = format!("{}_{}", parent_name, name.replace("_", "-")); + features.push(current_name.clone()); + + for child in children { + collect_child_features(child, features, ¤t_name); + } + } + } + + // Collect features from all children + for child in children { + collect_child_features(child, &mut all_features, &format!("endpoints_{}", name.replace("_", "-"))); + } + + // Create the feature gates string with all features + let features_str = all_features + .into_iter() + .filter(|f| f.chars().filter(|c| *c == '_').count() <= 2) + .map(|f| format!("feature = \"{}\"", f)) + .collect::>() + .join(", "); + + Some(format!( + "#[cfg(any(feature = \"endpoints\", {}))]\n#[cfg_attr(docsrs, doc(cfg(any(feature = \"endpoints\", {}))))]\npub mod {};", + features_str, + features_str, + name + )) + } else { + None + } + }) + .collect::>() + .join("\n"), + _ => String::new(), + }; + std::fs::write(format!("{}/mod.rs", base_module_path), root_mod_content) + .expect("Failed to write root mod.rs"); + + update_manifest_features(&mut manifest, &root, ""); + + let new_manifest = toml::to_string_pretty(&manifest).unwrap(); + std::fs::write("Cargo.toml", new_manifest).unwrap(); +} + +fn update_manifest_features(manifest: &mut Manifest, node: &Node, parent_path: &str) { + // Remove all features that start with "endpoint" + if let Some(features) = &mut manifest.features { + features.retain(|name, _| !name.starts_with("endpoint")); + } + + // Initialize features if not present + if manifest.features.is_none() { + manifest.features = Some(std::collections::BTreeMap::new()); + } + + // Add base endpoints feature + if let Some(features) = &mut manifest.features { + features.insert("endpoints".to_string(), vec![]); + } + + // Recursively add features for each module + add_module_features(manifest, node, parent_path); +} + +fn add_module_features(manifest: &mut Manifest, node: &Node, parent_path: &str) { + match node { + Node::Module { name, children } => { + let current_path = if parent_path.is_empty() { + name.clone() + } else { + format!("{}_{}", parent_path, name.replace("_", "-")) + }; + + // Count segments to determine depth + let segments: Vec<&str> = current_path.split('_').collect(); + + // Only add feature if we haven't exceeded 3 levels and we're not at the root level + if segments.len() <= 3 { + // We want endpoints_fal-ai_dreamshaper but not deeper + // Add feature for current module + if let Some(features) = &mut manifest.features { + features.insert(current_path.clone(), vec![]); + } + } + + // Recurse into children + for child in children { + add_module_features(manifest, child, ¤t_path); + } + } + Node::Leaf { .. } => { + // Leaf nodes don't need features + } + } +} diff --git a/crates/vendor/fal-rs/generate/src/module.rs b/crates/vendor/fal-rs/generate/src/module.rs new file mode 100644 index 0000000000..8c18575f6c --- /dev/null +++ b/crates/vendor/fal-rs/generate/src/module.rs @@ -0,0 +1,309 @@ +use std::collections::HashMap; + +use crate::types::schema_type_to_rust_type; + +pub enum Node { + Module { + name: String, + children: Vec, + }, + Leaf { + endpoint: String, + fn_name: String, + definition: serde_json::Value, + module_types: Vec, + output_type: serde_json::Value, + docs: String, + }, +} + +impl Node { + pub fn insert_path( + &mut self, + path_parts: &[&str], + endpoint: &str, + fn_name: &str, + definition: serde_json::Value, + module_types: Vec, + output_type: serde_json::Value, + docs: String, + ) { + match self { + Node::Module { children, .. } => { + if path_parts.is_empty() { + children.push(Node::Leaf { + endpoint: endpoint.to_string(), + fn_name: fn_name.to_string(), + definition, + module_types, + output_type, + docs, + }); + return; + } + + let current = path_parts[0]; + let remaining = &path_parts[1..]; + + // Find or create the child module + if let Some(child) = children.iter_mut().find(|n| match n { + Node::Module { name, .. } => name == current, + _ => false, + }) { + child.insert_path( + remaining, + endpoint, + fn_name, + definition, + module_types, + output_type, + docs, + ); + } else { + let mut new_module = Node::Module { + name: current.to_string(), + children: Vec::new(), + }; + new_module.insert_path( + remaining, + endpoint, + fn_name, + definition, + module_types, + output_type, + docs, + ); + children.push(new_module); + } + } + Node::Leaf { .. } => panic!("Cannot insert into a leaf node"), + } + } + + pub fn print_tree(&self, indent: usize) { + match self { + Node::Module { name, children } => { + tracing::trace!("{}Module: {}", " ".repeat(indent), name); + for child in children { + child.print_tree(indent + 2); + } + } + Node::Leaf { fn_name, .. } => { + tracing::trace!("{}Function: {}", " ".repeat(indent), fn_name); + } + } + } +} + +pub fn write_module_to_files(node: &Node, base_path: &str, is_root: bool) -> std::io::Result<()> { + match node { + Node::Module { name, children } => { + let module_path = if is_root { + base_path.to_string() + } else { + format!("{}/{}", base_path, name) + }; + + // Create directory if it doesn't exist + std::fs::create_dir_all(&module_path)?; + + // Start with an empty string for mod content + let mut mod_content = String::new(); + + // Get direct child functions and modules + let (functions, modules): (Vec<_>, Vec<_>) = children + .iter() + .partition(|child| matches!(child, Node::Leaf { .. })); + + // Add use declarations if we have direct functions/types + if !functions.is_empty() { + mod_content + .push_str("#[allow(unused_imports)]\nuse std::collections::HashMap;\n#[allow(unused_imports)]\nuse serde::{Serialize, Deserialize};\n#[allow(unused_imports)]\nuse crate::prelude::*;\n\n"); + } + + // Add pub mod declarations for child modules + let mut has_child_modules = false; + for child in &modules { + if let Node::Module { + name: child_name, .. + } = child + { + has_child_modules = true; + + let mut path_segments: Vec = module_path + .split('/') + .map(|s| s.replace("_", "-")) + .collect(); + path_segments.remove(0); // remove "src" + + // Helper function to collect all descendant features + fn collect_all_features(node: &Node, base_path: &[String]) -> Vec { + let mut features = Vec::new(); + + match node { + Node::Module { name, children: _ } => { + let mut current_path = base_path.to_vec(); + current_path.push(name.replace("_", "-")); + + let mut feature_path = vec![]; + + // Add each level of the path up to 3 levels + for segment in current_path.iter().take(3) { + feature_path.push(segment.clone()); + features.push(feature_path.join("_")); + } + } + Node::Leaf { .. } => {} + } + + features + } + + // Collect all features from this module and all its descendants + let mut all_features = collect_all_features(child, &path_segments); + + // Sort and deduplicate features + all_features.sort(); + all_features.dedup(); + + // Create the feature gates string with all features + let feature_cfg = if !all_features.is_empty() { + let features_map = all_features + .into_iter() + .map(|f| format!("feature = \"{}\"", f)) + .collect::>() + .join(", "); + + format!( + "#[cfg(any({features_map}))]\n#[cfg_attr(docsrs, doc(cfg(any({features_map}))))]", + ) + } else { + String::new() + }; + + let module_decl = if feature_cfg.is_empty() { + format!("pub mod {};\n", child_name) + } else { + format!("{}\npub mod {};\n", feature_cfg, child_name) + }; + + mod_content.push_str(&module_decl); + } + } + + // Add a newline after module declarations if we have both modules and content + if has_child_modules && !functions.is_empty() { + mod_content.push_str("\n"); + } + + // Add direct functions and types + if !functions.is_empty() { + for child in functions { + mod_content.push_str(&generate_request_module(child)); + } + } + + // Write mod.rs + std::fs::write(format!("{}/mod.rs", module_path), mod_content)?; + + // Recursively handle child modules + for child in modules { + if let Node::Module { .. } = child { + write_module_to_files(child, &module_path, false)?; + } + } + } + Node::Leaf { .. } => { + // Leaf nodes are handled within their parent module's mod.rs + } + } + + Ok(()) +} + +pub fn generate_request_module(node: &Node) -> String { + match node { + Node::Module { name, children } => { + format!( + r#" + pub mod {name} {{ + use super::*; + + {} + }} + "#, + children + .iter() + .map(|child| generate_request_module(child)) + .collect::>() + .join("\n") + ) + } + Node::Leaf { + endpoint, + fn_name, + definition, + module_types: input_types, + output_type, + docs, + } => { + let request_type_name = definition["requestBody"]["content"]["application/json"] + ["schema"]["$ref"] + .as_str() + .unwrap() + .split("/") + .last() + .unwrap(); + let return_type = output_type["title"].as_str().unwrap(); + + let mut extra_types = HashMap::new(); + + let mut input_types = input_types.clone(); + input_types.sort_by_key(|ty| ty["title"].as_str().unwrap().to_owned()); + + let input_structs = input_types + .iter() + .map(|input_type| { + schema_type_to_rust_type( + input_type, + &mut extra_types, + input_type["title"].as_str().unwrap_or_default() != return_type, + ) + }) + .collect::>() + .join("\n"); + let mut extra_types = extra_types.into_iter().collect::>(); + extra_types.sort_by_key(|(k, _)| k.clone()); + + let extra_types_str = extra_types + .into_iter() + .map(|(_, (_, item))| item) + .collect::>() + .join("\n\n"); + + let docs = docs + .trim() + .split("\n") + .map(|line| line.trim()) + .map(|line| format!("/// {line}")) + .collect::>() + .join("\n"); + + format!( + r#" + {input_structs} + + {extra_types_str} + + {docs} + pub fn {fn_name}(params: {request_type_name}) -> FalRequest<{request_type_name}, {return_type}> {{ + FalRequest::new( + "{endpoint}", + params + ) + }} + "#, + ) + } + } +} diff --git a/crates/vendor/fal-rs/generate/src/types.rs b/crates/vendor/fal-rs/generate/src/types.rs new file mode 100644 index 0000000000..ce54909132 --- /dev/null +++ b/crates/vendor/fal-rs/generate/src/types.rs @@ -0,0 +1,292 @@ +use std::collections::HashMap; + +use crate::fal_data::Model; +use crate::helpers::*; + +pub fn schema_type_to_rust_type( + info: &serde_json::Value, + extra_types: &mut HashMap, + input_type: bool, +) -> String { + let type_name = info["title"].as_str().unwrap().replace(" ", ""); + let params = info["properties"] + .as_object() + .unwrap() + .iter() + .map(|(k, v)| { + let is_required = info["required"] + .as_array() + .map(|a| a.contains(&serde_json::Value::String(k.to_string()))) + .unwrap_or(false); + + let prefix = if k == "type" { + "#[serde(rename = \"type\")]\npub ty:".to_owned() + } else if is_rust_keyword(k) { + format!("#[serde(rename = \"{k}\")]\npub r#{k}:") + } else { + let prop_name = to_snake_case(&k); + format!("pub {prop_name}:") + }; + + let serialization_attr = if !is_required { + "#[serde(skip_serializing_if = \"Option::is_none\")]\n" + } else { + "" + }; + + let description = v["description"].as_str().unwrap_or(""); + let examples = v["examples"].as_array(); + + let docs = if !description.is_empty() { + let description = description + .trim() + .split("\n") + .map(|line| line.trim()) + .map(|line| format!("/// {line}")) + .collect::>() + .join("\n"); + + if let Some(examples) = examples { + let examples = examples + .iter() + .map(|e| serde_json::to_string(e).unwrap()) + .map(|line| format!("/// {line}")) + .collect::>() + .join("\n"); + + format!("{description}\n{examples}\n") + } else { + format!("{description}\n") + } + } else { + "".to_string() + }; + + format!( + "{docs}{serialization_attr}{prefix} {}", + schema_property_to_rust_type(v, is_required, extra_types,) + ) + }) + .collect::>() + .join(",\n"); + + let default_derive = if input_type { ", Default" } else { "" }; + + format!( + r#" + #[derive(Debug, Serialize, Deserialize{default_derive})] + pub struct {type_name} {{ + {params} + }} + "# + ) +} + +pub fn schema_property_to_rust_type( + property: &serde_json::Value, + required: bool, + extra_types: &mut HashMap, +) -> String { + let type_name = match property["type"].as_str() { + Some("string") => "String".to_string(), + Some("number") => "f64".to_string(), + Some("integer") => "i64".to_string(), + Some("boolean") => "bool".to_string(), + Some("object") => { + if property["additionalProperties"].as_object().is_some() { + if let Some(title) = property["title"].as_str() { + get_or_build_object_type(title, property, extra_types) + } else { + tracing::warn!("[additionalProperties] no title for object: {:?}", property); + "HashMap".to_string() + } + } else { + "HashMap".to_string() + } + } + Some("array") => { + format!( + "Vec<{}>", + schema_property_to_rust_type(&property["items"], required, extra_types) + ) + } + _ => { + if let Some(reference) = property["$ref"].as_str() { + reference.split("/").last().unwrap().to_string() + } else if let Some(all_of) = property["allOf"].as_array() { + // fal API uses these to rename types usually, we should be able to just grab the first (only) element + if all_of.len() != 1 { + tracing::warn!("allOf != 1 element: {:?}", all_of); + } + + let first_element = all_of.first().unwrap(); + schema_property_to_rust_type(first_element, required, extra_types) + } else if let Some(one_of) = property["oneOf"].as_array() { + if one_of.len() == 1 { + schema_property_to_rust_type(one_of.first().unwrap(), required, extra_types) + } else { + if let Some(title) = property["title"].as_str() { + get_or_build_enum(title, one_of, extra_types) + } else { + tracing::warn!("no title for oneOf: {:?}", property); + "serde_json::Value".to_string() + } + } + } else if let Some(any_of) = property["anyOf"].as_array() { + if any_of.len() == 1 { + schema_property_to_rust_type(any_of.first().unwrap(), required, extra_types) + } else { + if let Some(title) = property["title"].as_str() { + // technically this is not correct per OpenAPI spec, + // but I don't think this is being used correctly in fal anyways + get_or_build_enum(title, any_of, extra_types) + } else { + tracing::warn!("no title for anyOf: {:?}", property); + "serde_json::Value".to_string() + } + } + } else { + tracing::warn!("Unsupported type: {:?}", property); + "serde_json::Value".to_string() + } + } + }; + + if required { + format!("{}", type_name) + } else { + format!("Option<{}>", type_name) + } +} + +// handle oneOf +pub fn get_or_build_enum( + title: &str, + options: &[serde_json::Value], + extra_types: &mut HashMap, +) -> String { + let mut enum_name = title.to_string(); + enum_name = enum_name + .replace(".", "_") + .replace("-", "_") + .replace(" ", ""); + enum_name = format!("{}Property", enum_name); + + if let Some((existing_type, _)) = extra_types.get(&enum_name) { + existing_type.clone() + } else { + let variants = options + .iter() + .enumerate() + .map(|(i, v)| { + if let Some(enum_options) = v["enum"].as_array() { + enum_options + .iter() + .enumerate() + .map(|(j, op)| { + let mut variant_name = + snake_to_upper_camel(op.as_str().unwrap()).replace(":", "_"); + if variant_name + .chars() + .next() + .map_or(false, |c| c.is_digit(10)) + { + let prefix = v["title"] + .as_str() + .map(|s| snake_to_upper_camel(s)) + .unwrap_or("Property".to_string()); + variant_name = format!("{prefix}_{variant_name}"); + } + let original_name = op.as_str().unwrap(); + let default_marker = if i == 0 && j == 0 { "#[default]\n" } else { "" }; + + format!("{default_marker}#[serde(rename=\"{original_name}\")]\n{variant_name}") + }) + .collect() + } else { + let variant_name = + if let Some(title) = v["title"].as_str() { + title.to_string() + } else if let Some(reference) = v["$ref"].as_str() { + reference.split("/").last().unwrap().to_string() + } else { + tracing::warn!("no title for oneOf: {:?}", v); + snake_to_upper_camel(v["type"].as_str().expect( + "if you don't have a title, you have to have a basic type =(", + )) + }; + let variant_name = variant_name + .replace(".", "_") + .replace("-", "_") + .replace(" ", ""); + + let variant_type = schema_property_to_rust_type(v, true, extra_types); + let default_marker = if i == 0 { "#[default]\n" } else { "" }; + + vec![format!("{default_marker}{variant_name}({variant_type})")] + } + }) + .flatten() + .collect::>() + .join(",\n"); + + let enum_type = format!( + "#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)]\n#[allow(non_camel_case_types)]\npub enum {enum_name}\n{{\n{variants}\n}}" + ); + + extra_types.insert(enum_name.clone(), (enum_name.clone(), enum_type.clone())); + + enum_name + } +} + +pub fn get_or_build_object_type( + title: &str, + property: &serde_json::Value, + extra_types: &mut HashMap, +) -> String { + let mut struct_name = title.to_string(); + struct_name = struct_name + .replace(".", "_") + .replace("-", "_") + .replace(" ", ""); + + if let Some((name, _)) = extra_types.get(&struct_name) { + name.clone() + } else { + let mut property = property.clone(); + property["properties"] = property["additionalProperties"].clone(); + let struct_impl = schema_type_to_rust_type(&property, extra_types, true); + extra_types.insert(struct_name.clone(), (struct_name.clone(), struct_impl)); + struct_name + } +} + +pub fn docs_from(model: &Model, openapi_params: &serde_json::Value) -> String { + let openapi_description = openapi_params["post"]["description"].as_str().unwrap_or(""); + + let title = &model.title; + let category = &model.category; + let machine_type = model + .machine_type + .as_ref() + .map(|s| format!("Machine Type: {s}")) + .unwrap_or("".to_string()); + let license_type = model + .license_type + .as_ref() + .map(|s| format!("License Type: {s}")) + .unwrap_or("".to_string()); + + format!( + " + {title} + + Category: {category} + {machine_type} + {license_type} + + {openapi_description} + " + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/easel_ai/advanced_face_swap/mod.rs b/crates/vendor/fal-rs/src/endpoints/easel_ai/advanced_face_swap/mod.rs new file mode 100644 index 0000000000..f217aad185 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/easel_ai/advanced_face_swap/mod.rs @@ -0,0 +1,107 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MirrorInput { + /// User's face image to face swap FROM + /// "https://images.easelai.com/mirror_fal/faces/dr.webp" + /// "https://images.easelai.com/mirror_fal/faces/ew.jpg" + /// "https://images.easelai.com/mirror_fal/faces/me.jpg" + /// "https://images.easelai.com/mirror_fal/faces/chani.png" + pub face_image_0: Image, + /// (Optional) The Second face image to face swap FROM + /// "https://images.easelai.com/mirror_fal/faces/chani.png" + /// "https://images.easelai.com/mirror_fal/faces/ew.jpg" + /// "https://images.easelai.com/mirror_fal/faces/me.jpg" + /// "https://images.easelai.com/mirror_fal/faces/dr.webp" + #[serde(skip_serializing_if = "Option::is_none")] + pub face_image_1: Option>, + /// The gender of the person in the face image. + pub gender_0: String, + /// The gender of the person in the second face image. + #[serde(skip_serializing_if = "Option::is_none")] + pub gender_1: Option, + /// The target image to face swap TO + /// "https://images.easelai.com/mirror_fal/men_single_player/tg.jpg" + /// "https://images.easelai.com/mirror_fal/men_single_player/bh.png" + /// "https://images.easelai.com/mirror_fal/men_single_player/rip.jpg" + /// "https://images.easelai.com/mirror_fal/men_single_player/th.jpg" + /// "https://images.easelai.com/mirror_fal/women_single_player/themark.jpg" + /// "https://images.easelai.com/mirror_fal/women_single_player/yellow.jpg" + /// "https://images.easelai.com/mirror_fal/women_single_player/diamond.jpg" + /// "https://images.easelai.com/mirror_fal/women_single_player/barbie.png" + /// "https://images.easelai.com/mirror_fal/multiplayer/bf.jpg" + /// "https://images.easelai.com/mirror_fal/multiplayer/hm.png" + /// "https://images.easelai.com/mirror_fal/multiplayer/tr.jpg" + /// "https://images.easelai.com/mirror_fal/multiplayer/mc.jpg" + /// "https://images.easelai.com/mirror_fal/multiplayer/sb.jpg" + /// "https://images.easelai.com/mirror_fal/multiplayer/wf.webp" + pub target_image: Image, + /// Apply 2x upscale and boost quality. Upscaling will refine the image and make the subjects brighter. + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale: Option, + /// The type of face swap workflow. target_hair = preserve target's hair. user_hair = preserve user's hair. + pub workflow_type: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MirrorOutput { + /// The mirrored image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Easel AI Advanced Face Swap +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn advanced_face_swap(params: MirrorInput) -> FalRequest { + FalRequest::new("easel-ai/advanced-face-swap", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/easel_ai/mod.rs b/crates/vendor/fal-rs/src/endpoints/easel_ai/mod.rs new file mode 100644 index 0000000000..1eae9882e9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/easel_ai/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_easel-ai", + feature = "endpoints_easel-ai_advanced-face-swap" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_easel-ai", + feature = "endpoints_easel-ai_advanced-face-swap" + ))) +)] +pub mod advanced_face_swap; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/frame_interpolation/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/frame_interpolation/mod.rs new file mode 100644 index 0000000000..b243dfd614 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/frame_interpolation/mod.rs @@ -0,0 +1,89 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AMTFrameInterpolationInput { + /// Frames to interpolate + /// [{"url":"https://storage.googleapis.com/falserverless/model_tests/amt-interpolation/start.png"},{"url":"https://storage.googleapis.com/falserverless/model_tests/amt-interpolation/end.png"}] + pub frames: Vec, + /// Output frames per second + #[serde(skip_serializing_if = "Option::is_none")] + pub output_fps: Option, + /// Number of recursive interpolation passes + #[serde(skip_serializing_if = "Option::is_none")] + pub recursive_interpolation_passes: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AMTInterpolationInput { + /// Output frames per second + #[serde(skip_serializing_if = "Option::is_none")] + pub output_fps: Option, + /// Number of recursive interpolation passes + #[serde(skip_serializing_if = "Option::is_none")] + pub recursive_interpolation_passes: Option, + /// URL of the video to be processed + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AMTInterpolationOutput { + /// Generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Frame { + /// URL of the frame + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// AMT Interpolation +/// +/// Category: video-to-video +/// Machine Type: A6000 +pub fn frame_interpolation( + params: AMTFrameInterpolationInput, +) -> FalRequest { + FalRequest::new("fal-ai/amt-interpolation/frame-interpolation", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/mod.rs new file mode 100644 index 0000000000..ee18651aa6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/amt_interpolation/mod.rs @@ -0,0 +1,104 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_amt-interpolation" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_amt-interpolation" + ))) +)] +pub mod frame_interpolation; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AMTFrameInterpolationInput { + /// Frames to interpolate + /// [{"url":"https://storage.googleapis.com/falserverless/model_tests/amt-interpolation/start.png"},{"url":"https://storage.googleapis.com/falserverless/model_tests/amt-interpolation/end.png"}] + pub frames: Vec, + /// Output frames per second + #[serde(skip_serializing_if = "Option::is_none")] + pub output_fps: Option, + /// Number of recursive interpolation passes + #[serde(skip_serializing_if = "Option::is_none")] + pub recursive_interpolation_passes: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AMTInterpolationInput { + /// Output frames per second + #[serde(skip_serializing_if = "Option::is_none")] + pub output_fps: Option, + /// Number of recursive interpolation passes + #[serde(skip_serializing_if = "Option::is_none")] + pub recursive_interpolation_passes: Option, + /// URL of the video to be processed + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AMTInterpolationOutput { + /// Generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Frame { + /// URL of the frame + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// AMT Interpolation +/// +/// Category: video-to-video +/// Machine Type: A6000 +pub fn amt_interpolation( + params: AMTInterpolationInput, +) -> FalRequest { + FalRequest::new("fal-ai/amt-interpolation", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_sparsectrl_lcm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_sparsectrl_lcm/mod.rs new file mode 100644 index 0000000000..56a7093f07 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_sparsectrl_lcm/mod.rs @@ -0,0 +1,103 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimatediffLCMInput { + /// The type of controlnet to use for generating the video. The controlnet determines how the video will be animated. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_type: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the first keyframe to use for the generation. + /// "https://storage.googleapis.com/falserverless/scribble2/scribble_2_1.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_0_image_url: Option, + /// The frame index of the first keyframe to use for the generation. + /// 0 + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_0_index: Option, + /// The URL of the second keyframe to use for the generation. + /// "https://storage.googleapis.com/falserverless/scribble2/scribble_2_2.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_1_image_url: Option, + /// The frame index of the second keyframe to use for the generation. + /// 8 + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_1_index: Option, + /// The URL of the third keyframe to use for the generation. + /// "https://storage.googleapis.com/falserverless/scribble2/scribble_2_3.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_2_image_url: Option, + /// The frame index of the third keyframe to use for the generation. + /// 15 + #[serde(skip_serializing_if = "Option::is_none")] + pub keyframe_2_index: Option, + /// The negative prompt to use. Use it to specify what you don't want. + /// "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Drone footage, futuristic city at night, synthwave, vaporware, neon lights, highly detailed, masterpeice, high quality" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable + /// Diffusion will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimatediffLCMOutput { + /// The seed used to generate the video. + pub seed: i64, + /// Generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + pub content_type: String, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + pub file_name: String, + /// The size of the file in bytes. + /// 4404019 + pub file_size: i64, + /// The URL where the file can be downloaded from. + /// "https://url.to/generated/file/z9RV14K95DvU.png" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Animatediff SparseCtrl LCM +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn animatediff_sparsectrl_lcm( + params: AnimatediffLCMInput, +) -> FalRequest { + FalRequest::new("fal-ai/animatediff-sparsectrl-lcm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/mod.rs new file mode 100644 index 0000000000..77101df66a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/mod.rs @@ -0,0 +1,180 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-v2v" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-v2v" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// Base model to use for animation generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub base_model: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, best quality, rocket in space, galaxies in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 537306 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Select every Nth frame from the video. + /// This can be used to reduce the number of frames to process, which can reduce the time and the cost. + /// However, it can also reduce the quality of the final video. + #[serde(skip_serializing_if = "Option::is_none")] + pub select_every_nth_frame: Option, + /// URL of the video. + /// "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + pub timings: Timings, + /// Generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/turbo-rocket-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, best quality, rocket in space, galaxies in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 537306 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Select every Nth frame from the video. + /// This can be used to reduce the number of frames to process, which can reduce the time and the cost. + /// However, it can also reduce the quality of the final video. + #[serde(skip_serializing_if = "Option::is_none")] + pub select_every_nth_frame: Option, + /// URL of the video. + /// "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboOutput { + /// Seed used for generating the video. + pub seed: i64, + pub timings: Timings, + /// Generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// AnimateDiff Video-to-Video Evolved +/// +/// Category: video-to-video +/// Machine Type: A100 +pub fn animatediff_v2v( + params: AnimateDiffV2VInput, +) -> FalRequest { + FalRequest::new("fal-ai/animatediff-v2v", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/turbo/mod.rs new file mode 100644 index 0000000000..cc398e5b19 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/animatediff_v2v/turbo/mod.rs @@ -0,0 +1,165 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// Base model to use for animation generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub base_model: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, best quality, rocket in space, galaxies in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 537306 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Select every Nth frame from the video. + /// This can be used to reduce the number of frames to process, which can reduce the time and the cost. + /// However, it can also reduce the quality of the final video. + #[serde(skip_serializing_if = "Option::is_none")] + pub select_every_nth_frame: Option, + /// URL of the video. + /// "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + pub timings: Timings, + /// Generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/turbo-rocket-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, best quality, rocket in space, galaxies in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 537306 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Select every Nth frame from the video. + /// This can be used to reduce the number of frames to process, which can reduce the time and the cost. + /// However, it can also reduce the quality of the final video. + #[serde(skip_serializing_if = "Option::is_none")] + pub select_every_nth_frame: Option, + /// URL of the video. + /// "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffV2VTurboOutput { + /// Seed used for generating the video. + pub seed: i64, + pub timings: Timings, + /// Generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// AnimateDiff Video-to-Video Evolved +/// +/// Category: video-to-video +/// Machine Type: A100 +pub fn turbo( + params: AnimateDiffV2VTurboInput, +) -> FalRequest { + FalRequest::new("fal-ai/animatediff-v2v/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/mod.rs new file mode 100644 index 0000000000..9184dde9ec --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/mod.rs @@ -0,0 +1,114 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_any-llm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_any-llm" + ))) +)] +pub mod vision; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ChatInput { + /// Name of the model to use. Premium models are charged at 10x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Prompt to be used for the chat completion + /// "What is the meaning of life?" + pub prompt: String, + /// Should reasoning be the part of the final answer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, + /// System prompt to provide context or instructions to the model + #[serde(skip_serializing_if = "Option::is_none")] + pub system_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ChatOutput { + /// Error message if an error occurred + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Generated output + /// "The meaning of life is subjective and depends on individual perspectives." + pub output: String, + /// Whether the output is partial + #[serde(skip_serializing_if = "Option::is_none")] + pub partial: Option, + /// Generated reasoning for the final answer + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VisionInput { + /// URL of the image to be processed + /// "https://fal.media/files/tiger/4Ew1xYW6oZCs6STQVC7V8_86440216d0fe42e4b826d03a2121468e.jpg" + pub image_url: String, + /// Name of the model to use. Premium models are charged at 3x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Prompt to be used for the image + /// "Caption this image for a text-to-image model with as much detail as possible." + pub prompt: String, + /// Should reasoning be the part of the final answer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, + /// System prompt to provide context or instructions to the model + /// "Only answer the question, do not provide any additional information or add any prefix/suffix other than the answer of the original question. Don't use markdown." + #[serde(skip_serializing_if = "Option::is_none")] + pub system_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ErrorProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SystemPromptProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +/// Any LLM +/// +/// Category: llm +/// Machine Type: A6000 +/// +/// +/// Run any large language model with fal, powered by [OpenRouter](https://openrouter.ai). +pub fn any_llm(params: ChatInput) -> FalRequest { + FalRequest::new("fal-ai/any-llm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/vision/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/vision/mod.rs new file mode 100644 index 0000000000..1f0cae3d4b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/any_llm/vision/mod.rs @@ -0,0 +1,99 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ChatInput { + /// Name of the model to use. Premium models are charged at 10x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Prompt to be used for the chat completion + /// "What is the meaning of life?" + pub prompt: String, + /// Should reasoning be the part of the final answer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, + /// System prompt to provide context or instructions to the model + #[serde(skip_serializing_if = "Option::is_none")] + pub system_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ChatOutput { + /// Error message if an error occurred + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Generated output + /// "The meaning of life is subjective and depends on individual perspectives." + pub output: String, + /// Whether the output is partial + #[serde(skip_serializing_if = "Option::is_none")] + pub partial: Option, + /// Generated reasoning for the final answer + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VisionInput { + /// URL of the image to be processed + /// "https://fal.media/files/tiger/4Ew1xYW6oZCs6STQVC7V8_86440216d0fe42e4b826d03a2121468e.jpg" + pub image_url: String, + /// Name of the model to use. Premium models are charged at 3x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Prompt to be used for the image + /// "Caption this image for a text-to-image model with as much detail as possible." + pub prompt: String, + /// Should reasoning be the part of the final answer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reasoning: Option, + /// System prompt to provide context or instructions to the model + /// "Only answer the question, do not provide any additional information or add any prefix/suffix other than the answer of the original question. Don't use markdown." + #[serde(skip_serializing_if = "Option::is_none")] + pub system_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ErrorProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SystemPromptProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +/// Any LLM +/// +/// Category: llm +/// Machine Type: A6000 +/// +/// +/// Run any vision model with fal, powered by [OpenRouter](https://openrouter.ai). +pub fn vision(params: VisionInput) -> FalRequest { + FalRequest::new("fal-ai/any-llm/vision", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_flow/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_flow/mod.rs new file mode 100644 index 0000000000..db3721fef7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_flow/mod.rs @@ -0,0 +1,90 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// Whether to perform prompt expansion (recommended) + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Classifier free guidance scale + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The number of images to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to take + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate images from + /// "Close-up portrait of a majestic iguana with vibrant blue-green scales, piercing amber eyes, and orange spiky crest. Intricate textures and details visible on scaly skin. Wrapped in dark hood, giving regal appearance. Dramatic lighting against black background. Hyper-realistic, high-resolution image showcasing the reptile's expressive features and coloration." + pub prompt: String, + /// The seed to use for generating images + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated images + pub images: Vec, + /// The expanded prompt + pub prompt: String, + /// The seed used to generate the images + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// AuraFlow +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn aura_flow(params: Input) -> FalRequest { + FalRequest::new("fal-ai/aura-flow", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_sr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_sr/mod.rs new file mode 100644 index 0000000000..6583eb9819 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/aura_sr/mod.rs @@ -0,0 +1,95 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// Checkpoint to use for upscaling. More coming soon. + /// "v2" + /// "v1" + #[serde(skip_serializing_if = "Option::is_none")] + pub checkpoint: Option, + /// URL of the image to upscale. + /// "https://fal.media/files/rabbit/JlBgYUyQRS3zxiBu_B4fM.png" + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + /// "https://fal.media/files/monkey/A6HGsigx4mmvs-hJVoOZX.png" + pub image_url: String, + /// Whether to use overlapping tiles for upscaling. Setting this to true helps remove seams but doubles the inference time. + /// true + /// false + #[serde(skip_serializing_if = "Option::is_none")] + pub overlapping_tiles: Option, + /// Upscaling factor. More coming soon. + /// 4 + #[serde(skip_serializing_if = "Option::is_none")] + pub upscaling_factor: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Upscaled image + pub image: Image, + /// Timings for each step in the pipeline. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// AuraSR +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn aura_sr(params: Input) -> FalRequest { + FalRequest::new("fal-ai/aura-sr", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/auto_caption/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/auto_caption/mod.rs new file mode 100644 index 0000000000..d4090d7149 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/auto_caption/mod.rs @@ -0,0 +1,76 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CaptionInput { + /// Size of text in generated captions. + #[serde(skip_serializing_if = "Option::is_none")] + pub font_size: Option, + /// Left-to-right alignment of the text. Can be a string ('left', 'center', 'right') or a float (0.0-1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub left_align: Option, + /// Number of seconds the captions should stay on screen. A higher number will also result in more text being displayed at once. + #[serde(skip_serializing_if = "Option::is_none")] + pub refresh_interval: Option, + /// Width of the text strokes in pixels + #[serde(skip_serializing_if = "Option::is_none")] + pub stroke_width: Option, + /// Top-to-bottom alignment of the text. Can be a string ('top', 'center', 'bottom') or a float (0.0-1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub top_align: Option, + /// Colour of the text. Can be a RGB tuple, a color name, or an hexadecimal notation. + #[serde(skip_serializing_if = "Option::is_none")] + pub txt_color: Option, + /// Font for generated captions. Choose one in 'Arial','Standard','Garamond', 'Times New Roman','Georgia', or pass a url to a .ttf file + #[serde(skip_serializing_if = "Option::is_none")] + pub txt_font: Option, + /// URL to the .mp4 video with audio. Only videos of size <100MB are allowed. + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URL to the caption .mp4 video. + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum LeftAlignProperty { + #[default] + String(String), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum TopAlignProperty { + #[default] + String(String), + Number(f64), +} + +/// Auto-Captioner +/// +/// Category: video-to-video +pub fn auto_caption(params: CaptionInput) -> FalRequest { + FalRequest::new("fal-ai/auto-caption", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/mod.rs new file mode 100644 index 0000000000..c2a85e5d93 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" + ))) +)] +pub mod v2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/image/mod.rs new file mode 100644 index 0000000000..cac9cc685f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/image/mod.rs @@ -0,0 +1,118 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2InputImage { + /// URL of image to be used for background removal + /// "https://storage.googleapis.com/falserverless/gallery/Ben2/arduino-uno-board-electronics-hand-600nw-1869855883.webp" + pub image_url: String, + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2InputVideo { + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of video to be used for background removal. + /// "https://storage.googleapis.com/falserverless/gallery/Ben2/100063-video-2160.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ben2OutputImage { + /// The output image after background removal. + /// {"content_type":"image/png","file_name":"zrZNETpI_ul2jonraqpxN_a57c3f3825d9418f8b3d39cde87c3310.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/gallery/Ben2/zrZNETpI_ul2jonraqpxN_a57c3f3825d9418f8b3d39cde87c3310.png","width":512} + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2OutputVideo { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/gallery/Ben2/foreground.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// ben-v2-image +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn image(params: Ben2InputImage) -> FalRequest { + FalRequest::new("fal-ai/ben/v2/image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/mod.rs new file mode 100644 index 0000000000..6756e52f7d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" + ))) +)] +pub mod image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" + ))) +)] +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/video/mod.rs new file mode 100644 index 0000000000..89fb1a0146 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ben/v2/video/mod.rs @@ -0,0 +1,118 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2InputImage { + /// URL of image to be used for background removal + /// "https://storage.googleapis.com/falserverless/gallery/Ben2/arduino-uno-board-electronics-hand-600nw-1869855883.webp" + pub image_url: String, + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2InputVideo { + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of video to be used for background removal. + /// "https://storage.googleapis.com/falserverless/gallery/Ben2/100063-video-2160.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ben2OutputImage { + /// The output image after background removal. + /// {"content_type":"image/png","file_name":"zrZNETpI_ul2jonraqpxN_a57c3f3825d9418f8b3d39cde87c3310.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/gallery/Ben2/zrZNETpI_ul2jonraqpxN_a57c3f3825d9418f8b3d39cde87c3310.png","width":512} + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ben2OutputVideo { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/gallery/Ben2/foreground.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// ben-v2-image +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn video(params: Ben2InputVideo) -> FalRequest { + FalRequest::new("fal-ai/ben/v2/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/mod.rs new file mode 100644 index 0000000000..23ee9fd005 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/mod.rs @@ -0,0 +1,145 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_birefnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_birefnet" + ))) +)] +pub mod v2; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// URL of the image to remove background from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// Model to use for background removal. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository. + /// The 'General Use (Heavy)' model is a slower but more accurate model. + /// The 'Portrait' model is a model trained specifically for portrait images. + /// The 'General Use (Light)' model is recommended for most use cases. + /// + /// The corresponding models are as follows: + /// - 'General Use (Light)': BiRefNet-DIS_ep580.pth + /// - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth + /// - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. + #[serde(skip_serializing_if = "Option::is_none")] + pub operating_resolution: Option, + /// The format of the output image + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Whether to output the mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub output_mask: Option, + /// Whether to refine the foreground using the estimated mask + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_foreground: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputV2 { + /// URL of the image to remove background from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// Model to use for background removal. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository but trained with 2K images. + /// The 'General Use (Heavy)' model is a slower but more accurate model. + /// The 'Matting' model is a model trained specifically for matting images. + /// The 'Portrait' model is a model trained specifically for portrait images. + /// The 'General Use (Light)' model is recommended for most use cases. + /// + /// The corresponding models are as follows: + /// - 'General Use (Light)': BiRefNet-DIS_ep580.pth + /// - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth + /// - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. + #[serde(skip_serializing_if = "Option::is_none")] + pub operating_resolution: Option, + /// The format of the output image + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Whether to output the mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub output_mask: Option, + /// Whether to refine the foreground using the estimated mask + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_foreground: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Image with background removed + pub image: Image, + /// Mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Birefnet Background Removal +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn birefnet(params: Input) -> FalRequest { + FalRequest::new("fal-ai/birefnet", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/v2/mod.rs new file mode 100644 index 0000000000..b4f3825b5c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/birefnet/v2/mod.rs @@ -0,0 +1,130 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// URL of the image to remove background from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// Model to use for background removal. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository. + /// The 'General Use (Heavy)' model is a slower but more accurate model. + /// The 'Portrait' model is a model trained specifically for portrait images. + /// The 'General Use (Light)' model is recommended for most use cases. + /// + /// The corresponding models are as follows: + /// - 'General Use (Light)': BiRefNet-DIS_ep580.pth + /// - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth + /// - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. + #[serde(skip_serializing_if = "Option::is_none")] + pub operating_resolution: Option, + /// The format of the output image + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Whether to output the mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub output_mask: Option, + /// Whether to refine the foreground using the estimated mask + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_foreground: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputV2 { + /// URL of the image to remove background from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// Model to use for background removal. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository. + /// The 'General Use (Light)' model is the original model used in the BiRefNet repository but trained with 2K images. + /// The 'General Use (Heavy)' model is a slower but more accurate model. + /// The 'Matting' model is a model trained specifically for matting images. + /// The 'Portrait' model is a model trained specifically for portrait images. + /// The 'General Use (Light)' model is recommended for most use cases. + /// + /// The corresponding models are as follows: + /// - 'General Use (Light)': BiRefNet-DIS_ep580.pth + /// - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth + /// - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. + #[serde(skip_serializing_if = "Option::is_none")] + pub operating_resolution: Option, + /// The format of the output image + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Whether to output the mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub output_mask: Option, + /// Whether to refine the foreground using the estimated mask + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_foreground: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Image with background removed + pub image: Image, + /// Mask used to remove the background + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Birefnet Background Removal +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn v2(params: InputV2) -> FalRequest { + FalRequest::new("fal-ai/birefnet/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/mod.rs new file mode 100644 index 0000000000..8648c09612 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod remove; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod replace; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/remove/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/remove/mod.rs new file mode 100644 index 0000000000..56def0df40 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/remove/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn remove(params: BGRemoveInput) -> FalRequest { + FalRequest::new("fal-ai/bria/background/remove", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/replace/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/replace/mod.rs new file mode 100644 index 0000000000..24fe7f87dd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/background/replace/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn replace(params: BGReplaceInput) -> FalRequest { + FalRequest::new("fal-ai/bria/background/replace", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/eraser/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/eraser/mod.rs new file mode 100644 index 0000000000..3523cc163e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/eraser/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn eraser(params: EraserInput) -> FalRequest { + FalRequest::new("fal-ai/bria/eraser", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/expand/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/expand/mod.rs new file mode 100644 index 0000000000..88652fcba1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/expand/mod.rs @@ -0,0 +1,447 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn expand( + params: ImageExpansionInput, +) -> FalRequest { + FalRequest::new("fal-ai/bria/expand", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/genfill/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/genfill/mod.rs new file mode 100644 index 0000000000..65d842ce2b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/genfill/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn genfill(params: GenFillInput) -> FalRequest { + FalRequest::new("fal-ai/bria/genfill", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/mod.rs new file mode 100644 index 0000000000..d138b2b6a2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/mod.rs @@ -0,0 +1,112 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod background; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod eraser; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod expand; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod genfill; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod product_shot; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod reimagine; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod text_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod upscale; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/product_shot/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/product_shot/mod.rs new file mode 100644 index 0000000000..68b51a052a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/product_shot/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn product_shot(params: ProductShotInput) -> FalRequest { + FalRequest::new("fal-ai/bria/product-shot", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/reimagine/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/reimagine/mod.rs new file mode 100644 index 0000000000..a2b5589a4a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/reimagine/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn reimagine(params: ReimagineInput) -> FalRequest { + FalRequest::new("fal-ai/bria/reimagine", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/base/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/base/mod.rs new file mode 100644 index 0000000000..07f4137f82 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/base/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn base(params: TextToImageRequest) -> FalRequest { + FalRequest::new("fal-ai/bria/text-to-image/base", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/fast/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/fast/mod.rs new file mode 100644 index 0000000000..63cc55156a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/fast/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn fast(params: FastTextToImageRequest) -> FalRequest { + FalRequest::new("fal-ai/bria/text-to-image/fast", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/hd/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/hd/mod.rs new file mode 100644 index 0000000000..72f78f9b0f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/hd/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn hd(params: TextToImageRequest) -> FalRequest { + FalRequest::new("fal-ai/bria/text-to-image/hd", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/mod.rs new file mode 100644 index 0000000000..dadaca8a3d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/text_to_image/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod base; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod fast; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod hd; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/upscale/mod.rs new file mode 100644 index 0000000000..11bfb724f3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/bria/upscale/mod.rs @@ -0,0 +1,445 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveInput { + /// Input Image to erase from + /// "https://fal.media/files/panda/K5Rndvzmn1j-OI1VZXDVd.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGRemoveOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"070c731993e949d993c10ef6283d335d.png","file_size":1076276,"height":1024,"url":"https://v3.fal.media/files/tiger/GQEMNjRyxSoza7N8LPPqb_070c731993e949d993c10ef6283d335d.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "Lilypad on a river" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Whether to refine prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub refine_prompt: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BGReplaceOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_bg_replace_res.jpg"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_img.png" + pub image_url: String, + /// You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in which the mask had been generated by a user (e.g. with a brush tool), and 'automatic' mask type should be used when mask had been generated by an algorithm like 'SAM'. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_type: Option, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_eraser_mask.png" + pub mask_url: String, + /// If set to true, attempts to preserve the alpha channel of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_alpha: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EraserOutput { + /// The generated image + /// {"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_eraser_res.png"} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillInput { + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_img.png" + pub image_url: String, + /// The URL of the binary mask image that represents the area that will be cleaned. + /// "https://storage.googleapis.com/falserverless/bria/bria_genfill_mask.png" + pub mask_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt you would like to use to generate images. + /// "A red delicious cherry" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GenFillOutput { + /// Generated Images + /// [{"content_type":"image/png","file_name":"a0d138e6820c4ad58f1fd3c758f16047.png","file_size":1064550,"height":768,"url":"https://storage.googleapis.com/falserverless/bria/bria_genfill_res.png","width":1024}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GuidanceInput { + /// The image that should be used as guidance, in base64 format, with the method defined in guidance_method_1. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. If more then one guidance method is used, all guidance images must be of the same aspect ratio, and this will be the aspect ratio of the generated results. If guidance_method_1 is selected, an image must be provided. + pub image_url: String, + /// Which guidance type you would like to include in the generation. Up to 4 guidance methods can be combined during a single inference. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// Impact of the guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionInput { + /// The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels. + /// [1200,674] + pub canvas_size: Vec, + /// The URL of the input image. + /// "https://storage.googleapis.com/falserverless/model_tests/orange.png" + pub image_url: String, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of Images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped). + /// [301,-66] + pub original_image_location: Vec, + /// The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results. + /// [610,855] + pub original_image_size: Vec, + /// Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageExpansionOutput { + /// The generated image + /// {"content_type":"image/png","file_name":"afa402a35ea742cdb5c3e219b2b19bfb.png","file_size":1471342,"height":674,"url":"https://v3.fal.media/files/koala/8np-spgxxG-I1r3cjthRV_afa402a35ea742cdb5c3e219b2b19bfb.png","width":1200} + pub image: Image, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated images + /// [{"content_type":"image/png","file_name":"257cf8e7bd3a47c2959396343d5b38cf.png","file_size":3731290,"height":1536,"url":"https://v3.fal.media/files/tiger/48e63e0K6C9XQYBuomoU-_257cf8e7bd3a47c2959396343d5b38cf.png","width":1536}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_fg.jpg" + pub image_url: String, + /// If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request. + #[serde(skip_serializing_if = "Option::is_none")] + pub manual_placement_selection: Option, + /// The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// Whether to optimize the scene description + #[serde(skip_serializing_if = "Option::is_none")] + pub optimize_description: Option, + /// This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_quality: Option, + /// The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API. + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_values: Option>>, + /// This parameter allows you to control the positioning of the product in the image. Choosing 'original' will preserve the original position of the product in the image. Choosing 'automatic' will generate results with the 10 recommended positions for the product. Choosing 'manual_placement' will allow you to select predefined positions (using the parameter 'manual_placement_selection'). Selecting 'manual_padding' will allow you to control the position and size of the image by defining the desired padding in pixels around the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub placement_type: Option, + /// The URL of the reference image to be used for generating the new scene or background for the product shot. Use "" to leave empty.Either ref_image_url or scene_description has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_product_bg.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_image_url: Option, + /// Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters. + /// "on a rock, next to the ocean, dark theme" + #[serde(skip_serializing_if = "Option::is_none")] + pub scene_description: Option, + /// The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type=automatic or placement_type=manual_placement. + #[serde(skip_serializing_if = "Option::is_none")] + pub shot_size: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProductShotOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_product_res.png"}] + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineInput { + /// Whether to use the fast model + #[serde(skip_serializing_if = "Option::is_none")] + pub fast: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_results: Option, + /// The prompt you would like to use to generate images. + /// "A 2d illustration of a dog in a vibrant park" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the structure reference image. Use "" to leave empty. Accepted formats are jpeg, jpg, png, webp. + /// "https://storage.googleapis.com/falserverless/bria/bria_reimagine_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_image_url: Option, + /// The influence of the structure reference on the generated image. + /// 0.15 + #[serde(skip_serializing_if = "Option::is_none")] + pub structure_ref_influence: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReimagineOutput { + /// The generated images + /// [{"content_type":"image/png","url":"https://storage.googleapis.com/falserverless/bria/bria_reimagine_output.png"}] + pub images: Vec, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the image. When a guidance method is being used, the aspect ratio is defined by the guidance image and this parameter is ignored. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance images to use for the generation. Up to 4 guidance methods can be combined during a single inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance: Option>>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Which medium should be included in your generated images. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub medium: Option, + /// The negative prompt you would like to use to generate images. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// How many images you would like to generate. When using any Guidance Method, Value is set to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of iterations the model goes through to refine the generated image. This parameter is optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt you would like to use to generate images. + /// "A lone figure stands on the edge of a serene cliff at sunset, gazing out over a vast, mystical valley. The figure is clad in flowing robes that ripple in the gentle breeze, silhouetted against the golden and lavender hues of the sky. Below, a cascading waterfall pours into a sparkling river winding through a forest of bioluminescent trees. The scene blends the awe of nature with a touch of otherworldly wonder, inviting reflection and imagination." + pub prompt: String, + /// When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_enhancement: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The desired increase in resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub desired_increase: Option, + /// Input Image to erase from + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + /// Result Image + /// {"content_type":"image/png","file_name":"db12c5f7076844d0bb84df92ab340acd.png","file_size":2494064,"height":1400,"url":"https://v3.fal.media/files/penguin/oHW1CIjw26zf3Jt-YLBTW_db12c5f7076844d0bb84df92ab340acd.png","width":1220} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Bria Text-to-Image Base +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn upscale(params: UpscaleInput) -> FalRequest { + FalRequest::new("fal-ai/bria/upscale", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/cat_vton/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/cat_vton/mod.rs new file mode 100644 index 0000000000..1ffea69da4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/cat_vton/mod.rs @@ -0,0 +1,131 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CATVTONInput { + /// Type of the Cloth to be tried on. + /// + /// Options: + /// upper: Upper body cloth + /// lower: Lower body cloth + /// overall: Full body cloth + /// inner: Inner cloth, like T-shirt inside a jacket + /// outer: Outer cloth, like a jacket over a T-shirt + /// "upper" + /// "lower" + /// "overall" + /// "inner" + /// "outer" + pub cloth_type: String, + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/catvton/tshirt.jpg" + pub garment_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/catvton/man5.jpg" + pub human_image_url: String, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same input given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CATVTONOutput { + /// The output image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// try-on +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: research +pub fn cat_vton(params: CATVTONInput) -> FalRequest { + FalRequest::new("fal-ai/cat-vton", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ccsr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ccsr/mod.rs new file mode 100644 index 0000000000..abf7bffc5d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ccsr/mod.rs @@ -0,0 +1,114 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CCSRInput { + /// Type of color correction for samples. + /// "adain" + /// "wavelet" + /// "none" + #[serde(skip_serializing_if = "Option::is_none")] + pub color_fix_type: Option, + /// The text prompt you would like to convert to speech. + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + pub image_url: String, + /// The scale of the output image. The higher the scale, the bigger the output image will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Seed for reproducibility. Different seeds will make slightly different results. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// The ending point of uniform sampling strategy. + #[serde(skip_serializing_if = "Option::is_none")] + pub t_max: Option, + /// The starting point of uniform sampling strategy. + #[serde(skip_serializing_if = "Option::is_none")] + pub t_min: Option, + /// If specified, a patch-based sampling strategy will be used for sampling. + /// "none" + /// "mix" + /// "gaussian" + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_diffusion: Option, + /// Size of patch. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_diffusion_size: Option, + /// Stride of sliding patch. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_diffusion_stride: Option, + /// If specified, a patch-based sampling strategy will be used for VAE decoding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_vae: Option, + /// Size of VAE patch. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_vae_decoder_size: Option, + /// Size of latent image + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_vae_encoder_size: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CCSROutput { + /// The generated image file info. + pub image: Image, + /// The seed used for the generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// CCSR Upscaler +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn ccsr(params: CCSRInput) -> FalRequest { + FalRequest::new("fal-ai/ccsr", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/clarity_upscaler/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/clarity_upscaler/mod.rs new file mode 100644 index 0000000000..da94dff3d3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/clarity_upscaler/mod.rs @@ -0,0 +1,159 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The creativity of the model. The higher the creativity, the more the model will deviate from the prompt. + /// Refers to the denoise strength of the sampling. + #[serde(skip_serializing_if = "Option::is_none")] + pub creativity: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to upscale. + /// "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want in the image. + /// "(worst quality, low quality, normal quality:2)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, best quality, highres" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image. The higher the resemblance, the more the model will try to keep the original image. + /// Refers to the strength of the ControlNet. + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The upscale factor + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The URL of the generated image. + pub image: Image, + /// The seed used to generate the image. + pub seed: i64, + /// The timings of the different steps in the workflow. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Clarity Upscaler +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn clarity_upscaler(params: Input) -> FalRequest { + FalRequest::new("fal-ai/clarity-upscaler", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/codeformer/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/codeformer/mod.rs new file mode 100644 index 0000000000..03f3ca6a97 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/codeformer/mod.rs @@ -0,0 +1,92 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CodeformerInput { + /// Should faces etc should be aligned. + #[serde(skip_serializing_if = "Option::is_none")] + pub aligned: Option, + /// Should faces be upscaled + #[serde(skip_serializing_if = "Option::is_none")] + pub face_upscale: Option, + /// Weight of the fidelity factor. + #[serde(skip_serializing_if = "Option::is_none")] + pub fidelity: Option, + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/model_tests/codeformer/codeformer_poor_1.jpeg" + pub image_url: String, + /// Should only center face be restored + #[serde(skip_serializing_if = "Option::is_none")] + pub only_center_face: Option, + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Upscaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub upscaling: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ConformerOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/model_tests/codeformer/codeformer_restored_1.jpeg","width":512} + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// CodeFormer +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn codeformer(params: CodeformerInput) -> FalRequest { + FalRequest::new("fal-ai/codeformer", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/image_to_video/mod.rs new file mode 100644 index 0000000000..93f2c4d2fa --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/image_to_video/mod.rs @@ -0,0 +1,224 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL to the image to generate the video from. + /// "https://d3phaj0sisr2ct.cloudfront.net/research/eugene.jpg" + pub image_url: String, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A low angle shot of a man walking down a street, illuminated by the neon signs of the bars around him" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The prompt used for generating the video. + pub prompt: String, + /// Seed of the generated video. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, + /// The URL to the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "An astronaut stands triumphantly at the peak of a towering mountain. Panorama of rugged peaks and valleys. Very futuristic vibe and animated aesthetic. Highlights of purple and golden colors in the scene. The sky is looks like an animated/cartoonish dream of galaxies, nebulae, stars, planets, moons, but the remainder of the scene is mostly realistic. " + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for Video to Video. 1.0 completely remakes the video while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, + /// The video to generate the video from. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/hiker.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// CogVideoX-5B +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Image to video generation using CogVideoX-5B. +pub fn image_to_video(params: ImageToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/cogvideox-5b/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/mod.rs new file mode 100644 index 0000000000..b8e03a33fd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/mod.rs @@ -0,0 +1,253 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" + ))) +)] +pub mod video_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL to the image to generate the video from. + /// "https://d3phaj0sisr2ct.cloudfront.net/research/eugene.jpg" + pub image_url: String, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A low angle shot of a man walking down a street, illuminated by the neon signs of the bars around him" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The prompt used for generating the video. + pub prompt: String, + /// Seed of the generated video. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, + /// The URL to the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "An astronaut stands triumphantly at the peak of a towering mountain. Panorama of rugged peaks and valleys. Very futuristic vibe and animated aesthetic. Highlights of purple and golden colors in the scene. The sky is looks like an animated/cartoonish dream of galaxies, nebulae, stars, planets, moons, but the remainder of the scene is mostly realistic. " + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for Video to Video. 1.0 completely remakes the video while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, + /// The video to generate the video from. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/hiker.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// CogVideoX-5B +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// CogVideoX-5B, next generation text-to-video model. +pub fn cogvideox_5b(params: BaseInput) -> FalRequest { + FalRequest::new("fal-ai/cogvideox-5b", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/video_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/video_to_video/mod.rs new file mode 100644 index 0000000000..bb75a540d3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogvideox_5b/video_to_video/mod.rs @@ -0,0 +1,224 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL to the image to generate the video from. + /// "https://d3phaj0sisr2ct.cloudfront.net/research/eugene.jpg" + pub image_url: String, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A low angle shot of a man walking down a street, illuminated by the neon signs of the bars around him" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The prompt used for generating the video. + pub prompt: String, + /// Seed of the generated video. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, + /// The URL to the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoToVideoInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The LoRAs to use for the image generation. We currently support one lora. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "An astronaut stands triumphantly at the peak of a towering mountain. Panorama of rugged peaks and valleys. Very futuristic vibe and animated aesthetic. Highlights of purple and golden colors in the scene. The sky is looks like an animated/cartoonish dream of galaxies, nebulae, stars, planets, moons, but the remainder of the scene is mostly realistic. " + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for Video to Video. 1.0 completely remakes the video while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// Use RIFE for video interpolation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_rife: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, + /// The video to generate the video from. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/hiker.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// CogVideoX-5B +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Video to video generation using CogVideoX-5B. +pub fn video_to_video(params: VideoToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/cogvideox-5b/video-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/cogview4/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogview4/mod.rs new file mode 100644 index 0000000000..bb5470bf88 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/cogview4/mod.rs @@ -0,0 +1,149 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated images + /// [{"content_type":"image/jpeg","height":768,"url":"https://v3.fal.media/files/tiger/rN6_PpE-o8QlSecqFku6h.jpeg","width":1024}] + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A vibrant and artistic digital composition featuring colorful splashes of paint in the background, creating an energetic and dynamic effect. The text 'CogView4 on Fal' is elegantly integrated into the scene, standing out with a modern, bold, and slightly futuristic font. The colors are bright and varied, including neon blues, purples, pinks, and oranges, blending seamlessly in a fluid, abstract style. The text appears slightly illuminated, complementing the vivid splashes around it." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// CogView4 +/// +/// Category: text-to-image +/// Machine Type: H100 +pub fn cogview4(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/cogview4", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/controlnext/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/controlnext/mod.rs new file mode 100644 index 0000000000..cbede2c047 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/controlnext/mod.rs @@ -0,0 +1,123 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNeXtInput { + /// Number of frames to process in each batch. + #[serde(skip_serializing_if = "Option::is_none")] + pub batch_frames: Option, + /// Condition scale for ControlNeXt. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnext_cond_scale: Option, + /// Chunk size for decoding frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub decode_chunk_size: Option, + /// Frames per second for the output video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// Guidance scale for the diffusion process. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Height of the output video. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// URL of the reference image. + /// "https://storage.googleapis.com/falserverless/model_tests/musepose/ref.png" + pub image_url: String, + /// Maximum number of frames to process. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_frame_num: Option, + /// Motion bucket ID for the pipeline. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// Number of inference steps. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Number of overlapping frames between batches. + #[serde(skip_serializing_if = "Option::is_none")] + pub overlap: Option, + /// Stride for sampling frames from the input video. + #[serde(skip_serializing_if = "Option::is_none")] + pub sample_stride: Option, + /// URL of the input video. + /// "https://storage.googleapis.com/falserverless/model_tests/musepose/dance.mp4" + pub video_url: String, + /// Width of the output video. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ControlNeXtOutput { + /// The generated video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// ControlNeXt SVD +/// +/// Category: video-to-video +/// Machine Type: A100 +/// License Type: commercial +pub fn controlnext(params: ControlNeXtInput) -> FalRequest { + FalRequest::new("fal-ai/controlnext", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/creative_upscaler/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/creative_upscaler/mod.rs new file mode 100644 index 0000000000..c96a9e0cd5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/creative_upscaler/mod.rs @@ -0,0 +1,143 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreativeUpscalerInput { + /// The URL to the additional embeddings to use for the upscaling. Default is None + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_embedding_url: Option, + /// The scale of the additional LORA model to use for the upscaling. Default is 1.0 + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_lora_scale: Option, + /// The URL to the additional LORA model to use for the upscaling. Default is None + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_lora_url: Option, + /// The URL to the base model to use for the upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub base_model_url: Option, + /// How much the output can deviate from the original + #[serde(skip_serializing_if = "Option::is_none")] + pub creativity: Option, + /// How much detail to add + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// If set to true, the resulting image will be checked whether it includes any + /// potentially unsafe content. If it does, it will be replaced with a black + /// image. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checks: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to upscale. + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + pub image_url: String, + /// The type of model to use for the upscaling. Default is SD_1_5 + /// "SD_1_5" + /// "SDXL" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_type: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to use for generating the image. The more steps + /// the better the image will be but it will also take longer to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Allow for large uploads that could take a very long time. + #[serde(skip_serializing_if = "Option::is_none")] + pub override_size_limits: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. If no prompt is provide BLIP2 will be used to generate a prompt. + + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The suffix to add to the prompt. This is useful to add a common ending to all prompts such as 'high quality' etc or embedding tokens. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_suffix: Option, + /// The scale of the output image. The higher the scale, the bigger the output image will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// How much to preserve the shape of the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub shape_preservation: Option, + /// If set to true, the image will not be processed by the CCSR model before + /// being processed by the creativity model. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_ccsr: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreativeUpscalerOutput { + /// The generated image file info. + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Creative Upscaler +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn creative_upscaler( + params: CreativeUpscalerInput, +) -> FalRequest { + FalRequest::new("fal-ai/creative-upscaler", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/csm_1b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/csm_1b/mod.rs new file mode 100644 index 0000000000..0a1c010694 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/csm_1b/mod.rs @@ -0,0 +1,88 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The context to generate an audio from. + /// [{"audio_url":"https://huggingface.co/spaces/sesame/csm-1b/resolve/main/prompts/conversational_a.wav","prompt":"like revising for an exam I'd have to try and like keep up the momentum because I'd start really early I'd be like okay I'm gonna start revising now and then like you're revising for ages and then I just like start losing steam I didn't do that for the exam we had recently to be fair that was a more of a last minute scenario but like yeah I'm trying to like yeah I noticed this yesterday that like Mondays I sort of start the day with this not like a panic but like a","speaker_id":0},{"audio_url":"https://huggingface.co/spaces/sesame/csm-1b/resolve/main/prompts/conversational_b.wav","prompt":"like a super Mario level. Like it's very like high detail. And like, once you get into the park, it just like, everything looks like a computer game and they have all these, like, you know, if, if there's like a, you know, like in a Mario game, they will have like a question block. And if you like, you know, punch it, a coin will come out. So like everyone, when they come into the park, they get like this little bracelet and then you can go punching question blocks around.","speaker_id":1}] + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option>>, + /// The text to generate an audio from. + /// [{"speaker_id":0,"text":"Hey how are you doing."},{"speaker_id":1,"text":"Pretty good, pretty good."},{"speaker_id":0,"text":"I'm great, so happy to be speaking to you."}] + pub scene: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated audio. + pub audio: AudioProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Speaker { + pub audio_url: String, + pub prompt: String, + pub speaker_id: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Turn { + pub speaker_id: i64, + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AudioProperty { + #[default] + File(File), + String(String), +} + +/// CSM-1B +/// +/// Category: text-to-audio +/// Machine Type: H100 +/// License Type: research +pub fn csm_1b(params: Input) -> FalRequest { + FalRequest::new("fal-ai/csm-1b", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ddcolor/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ddcolor/mod.rs new file mode 100644 index 0000000000..4f92fc5ed5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ddcolor/mod.rs @@ -0,0 +1,74 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DDColorInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/gallery/Screenshot%202025-02-26%20154226.png" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DDColorOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/gallery/5fcaaac6d1344d998ebb9703102c6c63.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DDColor +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn ddcolor(params: DDColorInput) -> FalRequest { + FalRequest::new("fal-ai/ddcolor", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/diffrhythm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/diffrhythm/mod.rs new file mode 100644 index 0000000000..33a120f7d7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/diffrhythm/mod.rs @@ -0,0 +1,84 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Generated music file. + /// {"content_type":"application/octet-stream","file_name":"output.wav","file_size":33554520,"url":"https://v3.fal.media/files/elephant/VV4wtKXBpZL1bNv6en36t_output.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToMusicInput { + /// The CFG strength to use for the music generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_strength: Option, + /// The prompt to generate the song from. Must have two sections. Sections start with either [chorus] or a [verse]. + /// "[00:10.00]Moonlight spills through broken blinds\n[00:13.20]Your shadow dances on the dashboard shrine\n[00:16.85]Neon ghosts in gasoline rain\n[00:20.40]I hear your laughter down the midnight train\n[00:24.15]Static whispers through frayed wires\n[00:27.65]Guitar strings hum our cathedral choirs\n[00:31.30]Flicker screens show reruns of June\n[00:34.90]I'm drowning in this mercury lagoon\n[00:38.55]Electric veins pulse through concrete skies\n[00:42.10]Your name echoes in the hollow where my heartbeat lies\n[00:45.75]We're satellites trapped in parallel light\n[00:49.25]Burning through the atmosphere of endless night\n[01:00.00]Dusty vinyl spins reverse\n[01:03.45]Our polaroid timeline bleeds through the verse\n[01:07.10]Telescope aimed at dead stars\n[01:10.65]Still tracing constellations through prison bars\n[01:14.30]Electric veins pulse through concrete skies\n[01:17.85]Your name echoes in the hollow where my heartbeat lies\n[01:21.50]We're satellites trapped in parallel light\n[01:25.05]Burning through the atmosphere of endless night\n[02:10.00]Clockwork gears grind moonbeams to rust\n[02:13.50]Our fingerprint smudged by interstellar dust\n[02:17.15]Velvet thunder rolls through my veins\n[02:20.70]Chasing phantom trains through solar plane\n[02:24.35]Electric veins pulse through concrete skies\n[02:27.90]Your name echoes in the hollow where my heartbeat lies\n" + pub lyrics: String, + /// The duration of the music to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub music_duration: Option, + /// The number of inference steps to use for the music generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the reference audio to use for the music generation. + /// "https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav" + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_audio_url: Option, + /// The scheduler to use for the music generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The style prompt to use for the music generation. + /// "pop" + #[serde(skip_serializing_if = "Option::is_none")] + pub style_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DiffRhythm: Lyrics to Song +/// +/// Category: text-to-audio +/// +/// License Type: commercial +pub fn diffrhythm(params: TextToMusicInput) -> FalRequest { + FalRequest::new("fal-ai/diffrhythm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/diffusion_edge/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/diffusion_edge/mod.rs new file mode 100644 index 0000000000..f0be1966bc --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/diffusion_edge/mod.rs @@ -0,0 +1,67 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DiffusionEdgeInput { + /// The text prompt you would like to convert to speech. + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/hamburger.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DiffusionEdgeOutput { + /// The generated image file info. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + pub content_type: String, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + pub file_name: String, + /// The size of the file in bytes. + /// 4404019 + pub file_size: i64, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + /// "https://url.to/generated/file/z9RV14K95DvU.png" + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DiffusionEdge +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn diffusion_edge( + params: DiffusionEdgeInput, +) -> FalRequest { + FalRequest::new("fal-ai/diffusion-edge", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/dewarp/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/dewarp/mod.rs new file mode 100644 index 0000000000..3fb20beb16 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/dewarp/mod.rs @@ -0,0 +1,88 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DocResInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/docres_ckpt/218_in.png" + pub image_url: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Task to perform + pub task: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DocResInputDewarp { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/docres_ckpt/218_in.png" + pub image_url: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DocResOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/docres_ckpt/Xssvg5K39QiD6mn9K5toF_f4942abeef8d4c7bbe236b59aed5e382.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DocRes +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn dewarp(params: DocResInputDewarp) -> FalRequest { + FalRequest::new("fal-ai/docres/dewarp", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/mod.rs new file mode 100644 index 0000000000..fc0ae9c073 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/docres/mod.rs @@ -0,0 +1,103 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_docres" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_docres" + ))) +)] +pub mod dewarp; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DocResInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/docres_ckpt/218_in.png" + pub image_url: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Task to perform + pub task: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DocResInputDewarp { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/docres_ckpt/218_in.png" + pub image_url: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DocResOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/docres_ckpt/Xssvg5K39QiD6mn9K5toF_f4942abeef8d4c7bbe236b59aed5e382.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DocRes +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn docres(params: DocResInput) -> FalRequest { + FalRequest::new("fal-ai/docres", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/drct_super_resolution/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/drct_super_resolution/mod.rs new file mode 100644 index 0000000000..7fbec1080b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/drct_super_resolution/mod.rs @@ -0,0 +1,76 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// URL of the image to upscale. + /// "https://fal.media/files/rabbit/JlBgYUyQRS3zxiBu_B4fM.png" + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + /// "https://fal.media/files/monkey/A6HGsigx4mmvs-hJVoOZX.png" + pub image_url: String, + /// Upscaling factor. + /// 4 + #[serde(skip_serializing_if = "Option::is_none")] + pub upscaling_factor: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DRCT-Super-Resolution +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn drct_super_resolution(params: Input) -> FalRequest { + FalRequest::new("fal-ai/drct-super-resolution", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/image_to_image/mod.rs new file mode 100644 index 0000000000..3f6aafa15c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/image_to_image/mod.rs @@ -0,0 +1,300 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Dreamshaper +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: DreamshaperImageToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/dreamshaper/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/inpainting/mod.rs new file mode 100644 index 0000000000..b285fa1ad4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/inpainting/mod.rs @@ -0,0 +1,300 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Dreamshaper +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting( + params: DreamshaperInpaintingInput, +) -> FalRequest { + FalRequest::new("fal-ai/dreamshaper/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/mod.rs new file mode 100644 index 0000000000..7629729998 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/dreamshaper/mod.rs @@ -0,0 +1,329 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DreamshaperTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Dreamshaper model to use. + /// "Lykon/dreamshaper-8" + /// "Lykon/dreamshaper-xl-1-0" + /// "Lykon/dreamshaper-xl-v2-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Dreamshaper +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn dreamshaper( + params: DreamshaperTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/dreamshaper", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/dubbing/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/dubbing/mod.rs new file mode 100644 index 0000000000..dee39fdc97 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/dubbing/mod.rs @@ -0,0 +1,70 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputModel { + /// Whether to lip sync the audio to the video + #[serde(skip_serializing_if = "Option::is_none")] + pub do_lipsync: Option, + /// Target language to dub the video to + #[serde(skip_serializing_if = "Option::is_none")] + pub target_language: Option, + /// Input video URL to be dubbed. + /// "https://storage.googleapis.com/falserverless/model_tests/dubbing/swapjokes_clip_cropped.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputModel { + /// The generated video with the lip sync. + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":120000,"url":"https://v3.fal.media/files/koala/7BzEwUucbr6yuFjpcJipl_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Dubbing +/// +/// Category: video-to-video +/// +/// License Type: commercial +pub fn dubbing(params: InputModel) -> FalRequest { + FalRequest::new("fal-ai/dubbing", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/dwpose/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/dwpose/mod.rs new file mode 100644 index 0000000000..849dd3170d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/dwpose/mod.rs @@ -0,0 +1,70 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DWPoseInput { + /// URL of the image to be processed + /// "https://github.com/badayvedat/sane-controlnet-aux/blob/main/tests/data/pose_sample.jpg?raw=true" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DWPoseOutput { + /// The predicted pose image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// DWPose Pose Prediction +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn dwpose(params: DWPoseInput) -> FalRequest { + FalRequest::new("fal-ai/dwpose", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/audio_isolation/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/audio_isolation/mod.rs new file mode 100644 index 0000000000..29df2c7c84 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/audio_isolation/mod.rs @@ -0,0 +1,203 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Audio Isolation: Extract clean voice from audio. +/// +/// Isolates and enhances voice content from audio files, removing background noise, +/// music, and other non-voice sounds. +pub fn audio_isolation( + params: AudioIsolationRequest, +) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/audio-isolation", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/clone_voice/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/clone_voice/mod.rs new file mode 100644 index 0000000000..f612d45ef2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/clone_voice/mod.rs @@ -0,0 +1,200 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Voice Cloning: Add a new voice to the system. +pub fn clone_voice( + params: VoiceCloningRequest, +) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/clone-voice", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/mod.rs new file mode 100644 index 0000000000..86435facab --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/mod.rs @@ -0,0 +1,70 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod audio_isolation; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod clone_voice; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod sound_effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod speech_to_text; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod tts; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/sound_effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/sound_effects/mod.rs new file mode 100644 index 0000000000..ee305cb64b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/sound_effects/mod.rs @@ -0,0 +1,203 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Sound Effects Generation. +/// +/// Turn text into sound effects for videos, voice-overs or video games using +/// state-of-the-art sound generation technology. +pub fn sound_effects( + params: SoundEffectRequest, +) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/sound-effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/speech_to_text/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/speech_to_text/mod.rs new file mode 100644 index 0000000000..552ecb36bb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/speech_to_text/mod.rs @@ -0,0 +1,203 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Speech to Text: Transcribe audio with high accuracy. +/// +/// Transforms spoken audio into text with word-level timestamps and +/// optional speaker identification. Supports 99 languages with state-of-the-art accuracy. +pub fn speech_to_text( + params: SpeechToTextRequest, +) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/speech-to-text", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/mod.rs new file mode 100644 index 0000000000..b2fe198b1a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod multilingual_v2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod turbo_v2_5; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/multilingual_v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/multilingual_v2/mod.rs new file mode 100644 index 0000000000..6fd6e18ea6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/multilingual_v2/mod.rs @@ -0,0 +1,201 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Multilingual v2 model for text-to-speech generation. +/// +/// Excels in stability, language diversity, and accent accuracy. +/// Supports 29 languages with high-quality, natural-sounding voices. +pub fn multilingual_v2(params: TextToSpeechRequest) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/tts/multilingual-v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/turbo_v2_5/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/turbo_v2_5/mod.rs new file mode 100644 index 0000000000..56ff8d8d50 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/elevenlabs/tts/turbo_v2_5/mod.rs @@ -0,0 +1,201 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The input audio file + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioIsolationRequest { + /// URL of the audio file to isolate voice from + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectOutput { + /// The generated sound effect audio file in MP3 format + /// {"url":"https://v3.fal.media/files/lion/WgnO-jy6WduosuG_Ibobx_sound_effect.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoundEffectRequest { + /// Duration in seconds (0.5-22). If None, optimal duration will be determined from prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_seconds: Option, + /// How closely to follow the prompt (0-1). Higher values mean less variation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_influence: Option, + /// The text describing the sound effect to generate + /// "Spacious braam suitable for high-impact movie trailer moments" + /// "A gentle wind chime tinkling in a soft breeze" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpeechToTextRequest { + /// URL of the audio file to transcribe + /// "https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3" + pub audio_url: String, + /// Whether to annotate who is speaking + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language code of the audio + /// "eng" + /// "spa" + /// "fra" + /// "deu" + /// "jpn" + #[serde(skip_serializing_if = "Option::is_none")] + pub language_code: Option, + /// Tag audio events like laughter, applause, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_audio_events: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TTSOutput { + /// The generated audio file + /// {"url":"https://v3.fal.media/files/zebra/zJL_oRY8h5RWwjoK1w7tx_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToSpeechRequest { + /// Similarity boost (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub similarity_boost: Option, + /// Voice stability (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + /// Style exaggeration (0-1) + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The text to convert to speech + /// "Hello! This is a test of the text to speech system, powered by ElevenLabs. How does it sound?" + pub text: String, + /// The voice to use for speech generation + /// "Aria" + /// "Roger" + /// "Sarah" + /// "Laura" + /// "Charlie" + /// "George" + /// "Callum" + /// "River" + /// "Liam" + /// "Charlotte" + /// "Alice" + /// "Matilda" + /// "Will" + /// "Jessica" + /// "Eric" + /// "Chris" + /// "Brian" + /// "Daniel" + /// "Lily" + /// "Bill" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionOutput { + /// Detected or specified language code + pub language_code: String, + /// Confidence in language detection + pub language_probability: f64, + /// The full transcribed text + pub text: String, + /// Word-level transcription details + pub words: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TranscriptionWord { + /// End time in seconds + pub end: f64, + /// Speaker identifier if diarization was enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker_id: Option, + /// Start time in seconds + pub start: f64, + /// The transcribed word or audio event + pub text: String, + /// Type of element (word, spacing, or audio_event) + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningOutput { + /// The id of the cloned voice + /// "hWom0fkbma5jw98sykZx" + pub voice_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VoiceCloningRequest { + /// List of audio files to use for voice cloning + pub audio_urls: Vec, + /// Whether to remove background noise from the audio files + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_background_noise: Option, +} + +/// ElevenLabs Audio Isolation +/// +/// Category: audio-to-audio +/// +/// License Type: commercial +/// +/// ElevenLabs Turbo v2.5 model for text-to-speech generation. +/// +/// High quality with lowest latency, ideal for real-time applications. +/// Supports 32 languages while maintaining natural voice quality. +pub fn turbo_v2_5(params: TextToSpeechRequest) -> FalRequest { + FalRequest::new("fal-ai/elevenlabs/tts/turbo-v2.5", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/era_3d/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/era_3d/mod.rs new file mode 100644 index 0000000000..e75b032d7c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/era_3d/mod.rs @@ -0,0 +1,127 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Era3DInput { + /// Background removal + #[serde(skip_serializing_if = "Option::is_none")] + pub background_removal: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg: Option, + /// Size of the image to crop to + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_size: Option, + /// URL of the image to remove background from + /// "https://storage.googleapis.com/falserverless/model_tests/era3d/DnvGjd9CCS-ESmLgTYgOn.png" + pub image_url: String, + /// Seed for random number generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Number of steps to run the model for + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Era3DOutput { + /// Images with background removed + pub images: Vec, + /// Normal images with background removed + pub normal_images: Vec, + /// Seed used for random number generation + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Era 3D +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn era_3d(params: Era3DInput) -> FalRequest { + FalRequest::new("fal-ai/era-3d", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/esrgan/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/esrgan/mod.rs new file mode 100644 index 0000000000..04f6395aac --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/esrgan/mod.rs @@ -0,0 +1,124 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Upscale Images +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn esrgan(params: UpscaleInput) -> FalRequest { + FalRequest::new("fal-ai/esrgan", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/evf_sam/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/evf_sam/mod.rs new file mode 100644 index 0000000000..9010b8b098 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/evf_sam/mod.rs @@ -0,0 +1,88 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Apply Gaussian blur to the mask. Value determines kernel size (must be odd number) + #[serde(skip_serializing_if = "Option::is_none")] + pub blur_mask: Option, + /// Expand/dilate the mask by specified pixels + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_mask: Option, + /// Fill holes in the mask using morphological operations + #[serde(skip_serializing_if = "Option::is_none")] + pub fill_holes: Option, + /// URL of the input image + /// "https://storage.googleapis.com/falserverless/web-examples/evf-sam2/evfsam2-cat.png" + pub image_url: String, + /// Output only the binary mask instead of masked image + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_only: Option, + /// Areas to exclude from segmentation (will be subtracted from prompt results) + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to generate segmentation from. + /// "Cat in the middle of the image" + pub prompt: String, + /// Invert the mask (background becomes foreground and vice versa) + #[serde(skip_serializing_if = "Option::is_none")] + pub revert_mask: Option, + /// Enable semantic level segmentation for body parts, background or multi objects + #[serde(skip_serializing_if = "Option::is_none")] + pub semantic_type: Option, + /// Use GroundingDINO instead of SAM for segmentation + #[serde(skip_serializing_if = "Option::is_none")] + pub use_grounding_dino: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The segmented output image + pub image: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// EVF-SAM2 Segmentation +/// +/// Category: image-to-image +pub fn evf_sam(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/evf-sam", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/eye_correct/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/eye_correct/mod.rs new file mode 100644 index 0000000000..f67d8b50a7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/eye_correct/mod.rs @@ -0,0 +1,61 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EyeCorrectInput { + /// The URL of the video to correct + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct EyeCorrectOutput { + /// The corrected video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Eye Correct +/// +/// Category: video-to-video +/// Machine Type: A100 +pub fn eye_correct(params: EyeCorrectInput) -> FalRequest { + FalRequest::new("fal-ai/eye-correct", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/f5_tts/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/f5_tts/mod.rs new file mode 100644 index 0000000000..c70a0273d6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/f5_tts/mod.rs @@ -0,0 +1,74 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioFile { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TTSInput { + /// The text to be converted to speech. + /// "I don't really care what you call me. I've been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and enduring. Respect me and I'll nurture you; ignore me and you shall face the consequences." + pub gen_text: String, + /// The name of the model to be used for TTS. + pub model_type: String, + /// The URL of the reference audio file. + /// "https://github.com/SWivid/F5-TTS/raw/21900ba97d5020a5a70bcc9a0575dc7dec5021cb/tests/ref_audio/test_en_1_ref_short.wav" + pub ref_audio_url: String, + /// The reference text to be used for TTS. If not provided, an ASR (Automatic Speech Recognition) model will be used to generate the reference text. + /// "Some call me nature, others call me mother nature." + #[serde(skip_serializing_if = "Option::is_none")] + pub ref_text: Option, + /// Whether to remove the silence from the audio file. + #[serde(skip_serializing_if = "Option::is_none")] + pub remove_silence: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TTSOutput { + /// The audio file containing the generated speech. + pub audio_url: AudioFile, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// F5 TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn f5_tts(params: TTSInput) -> FalRequest { + FalRequest::new("fal-ai/f5-tts", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/face_to_sticker/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/face_to_sticker/mod.rs new file mode 100644 index 0000000000..75920bc223 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/face_to_sticker/mod.rs @@ -0,0 +1,164 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceToStickerInput { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of the video. + /// "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg" + pub image_url: String, + /// The strength of the instant ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub instant_id_strength: Option, + /// The amount of noise to add to the IP adapter. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_noise: Option, + /// The weight of the IP adapter. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_weight: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a person" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Whether to upscale the image 2x. + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale: Option, + /// The number of steps to use for upscaling. Only used if `upscale` is `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FaceToStickerOutput { + /// Whether the generated images contain NSFW concepts. + /// The key is the image type and the value is a boolean. + /// {"sticker_image":false,"sticker_image_background_removed":false} + pub has_nsfw_concepts: HasNsfwConcepts, + /// The generated images. + /// [{"content_type":"image/PNG","file_name":"cd8bab71b946470099d5fa20c7eed440.png","file_size":560358,"height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png","width":1024},{"content_type":"image/PNG","file_name":"181ae8fa12534c6f9285a991b415d9a7.png","file_size":452906,"height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png","width":1024}] + pub images: Vec, + /// Seed used during the inference. + /// 3625437076 + pub seed: i64, + /// The generated face sticker image. + /// {"content_type":"image/PNG","file_name":"cd8bab71b946470099d5fa20c7eed440.png","file_size":560358,"height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png","width":1024} + pub sticker_image: Image, + /// The generated face sticker image with the background removed. + /// {"content_type":"image/PNG","file_name":"181ae8fa12534c6f9285a991b415d9a7.png","file_size":452906,"height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png","width":1024} + pub sticker_image_background_removed: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HasNsfwConcepts { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Face to Sticker +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: research +pub fn face_to_sticker( + params: FaceToStickerInput, +) -> FalRequest { + FalRequest::new("fal-ai/face-to-sticker", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/mod.rs new file mode 100644 index 0000000000..1b5dfb1311 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod text_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod turbo; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod video_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/text_to_video/mod.rs new file mode 100644 index 0000000000..1025ac2068 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/text_to_video/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffT2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/kangaroo/DSrFBOk9XXIplm_kukI4n.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VTurboInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/koala/5Cb_6P_s9wW8f8-g9c4yj.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// AnimateDiff +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn text_to_video( + params: AnimateDiffT2VInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-animatediff/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/mod.rs new file mode 100644 index 0000000000..9d00e58fb3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod text_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod video_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/text_to_video/mod.rs new file mode 100644 index 0000000000..51dc4c88f3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/text_to_video/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffT2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/kangaroo/DSrFBOk9XXIplm_kukI4n.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VTurboInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/koala/5Cb_6P_s9wW8f8-g9c4yj.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// AnimateDiff +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn text_to_video( + params: AnimateDiffT2VTurboInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-animatediff/turbo/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/video_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/video_to_video/mod.rs new file mode 100644 index 0000000000..1c4b67c054 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/turbo/video_to_video/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/kangaroo/DSrFBOk9XXIplm_kukI4n.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VTurboInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/koala/5Cb_6P_s9wW8f8-g9c4yj.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// AnimateDiff +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn video_to_video( + params: AnimateDiffV2VTurboInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-animatediff/turbo/video-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/video_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/video_to_video/mod.rs new file mode 100644 index 0000000000..00ad1f4df9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_animatediff/video_to_video/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/kangaroo/DSrFBOk9XXIplm_kukI4n.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffT2VTurboInput { + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of frames to generate for the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the video. Be as descriptive as possible for best results. + /// "masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AnimateDiffV2VOutput { + /// Seed used for generating the video. + pub seed: i64, + /// Generated video file. + /// {"url":"https://fal-cdn.batuhan-941.workers.dev/files/koala/5Cb_6P_s9wW8f8-g9c4yj.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AnimateDiffV2VTurboInput { + /// The first N number of seconds of video to animate. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_n_seconds: Option, + /// Number of frames per second to extract from the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The motions to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub motions: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. 4-12 is recommended for turbo mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "closeup of tony stark, robert downey jr, fireworks, high quality, ultra HD" + /// "panda playing a guitar, on a boat, in the ocean, high quality, high quality, ultra HD, realistic" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the input video in the final output. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// AnimateDiff +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn video_to_video( + params: AnimateDiffV2VInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-animatediff/video-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/image_to_image/mod.rs new file mode 100644 index 0000000000..c45f617473 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/image_to_image/mod.rs @@ -0,0 +1,285 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the prompt image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: ImageToImageFooocusInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-fooocus-sdxl/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/inpainting/mod.rs new file mode 100644 index 0000000000..000c73b290 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/inpainting/mod.rs @@ -0,0 +1,283 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the prompt image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting(params: InpaintingFooocusInput) -> FalRequest { + FalRequest::new("fal-ai/fast-fooocus-sdxl/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/mod.rs new file mode 100644 index 0000000000..afbcd06a27 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_fooocus_sdxl/mod.rs @@ -0,0 +1,314 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the prompt image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageFooocusInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, a smaller model will try to refine the output after it was processed. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_refiner: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn fast_fooocus_sdxl( + params: TextToImageFooocusInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-fooocus-sdxl", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/image_to_image/mod.rs new file mode 100644 index 0000000000..6e069b8d7a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/image_to_image/mod.rs @@ -0,0 +1,306 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Latent Consistency Models (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn image_to_image(params: ImageToImageLCMInput) -> FalRequest { + FalRequest::new("fal-ai/fast-lcm-diffusion/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/inpainting/mod.rs new file mode 100644 index 0000000000..43bd1967d0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/inpainting/mod.rs @@ -0,0 +1,306 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Latent Consistency Models (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn inpainting(params: InpaintingLCMInput) -> FalRequest { + FalRequest::new("fal-ai/fast-lcm-diffusion/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/mod.rs new file mode 100644 index 0000000000..489c5130c6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lcm_diffusion/mod.rs @@ -0,0 +1,335 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLCMInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k." + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Latent Consistency Models (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn fast_lcm_diffusion(params: TextToImageLCMInput) -> FalRequest { + FalRequest::new("fal-ai/fast-lcm-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/image_to_image/mod.rs new file mode 100644 index 0000000000..6f50e7cf4f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/image_to_image/mod.rs @@ -0,0 +1,238 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a girl smiling during a sunset, with lightnings in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL Lightning +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: ImageToImageLightningInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-lightning-sdxl/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/inpainting/mod.rs new file mode 100644 index 0000000000..b63f16f4dc --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/inpainting/mod.rs @@ -0,0 +1,238 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a girl smiling during a sunset, with lightnings in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL Lightning +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting( + params: InpaintingLightningInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-lightning-sdxl/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/mod.rs new file mode 100644 index 0000000000..9e2937622a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_lightning_sdxl/mod.rs @@ -0,0 +1,267 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageLightningInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a girl smiling during a sunset, with lightnings in the background" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL Lightning +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn fast_lightning_sdxl( + params: TextToImageLightningInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-lightning-sdxl", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/image_to_image/mod.rs new file mode 100644 index 0000000000..083a91ada9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/image_to_image/mod.rs @@ -0,0 +1,312 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the output cropped to the proper aspect ratio after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_output: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// If set to true, the aspect ratio of the generated image will be preserved even + /// if the image size is too large. However, if the image is not a multiple of 32 + /// in width or height, it will be resized to the nearest multiple of 32. By default, + /// this snapping to the nearest multiple of 32 will not preserve the aspect ratio. + /// Set crop_output to True, to crop the output to the proper aspect ratio + /// after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_aspect_ratio: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/inpainting/mod.rs new file mode 100644 index 0000000000..d67aa0b209 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/inpainting/mod.rs @@ -0,0 +1,312 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the output cropped to the proper aspect ratio after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_output: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// If set to true, the aspect ratio of the generated image will be preserved even + /// if the image size is too large. However, if the image is not a multiple of 32 + /// in width or height, it will be resized to the nearest multiple of 32. By default, + /// this snapping to the nearest multiple of 32 will not preserve the aspect ratio. + /// Set crop_output to True, to crop the output to the proper aspect ratio + /// after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_aspect_ratio: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting(params: InpaintingInput) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/mod.rs new file mode 100644 index 0000000000..06423689f7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl/mod.rs @@ -0,0 +1,341 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the output cropped to the proper aspect ratio after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_output: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// If set to true, the aspect ratio of the generated image will be preserved even + /// if the image size is too large. However, if the image is not a multiple of 32 + /// in width or height, it will be resized to the nearest multiple of 32. By default, + /// this snapping to the nearest multiple of 32 will not preserve the aspect ratio. + /// Set crop_output to True, to crop the output to the proper aspect ratio + /// after generating. + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_aspect_ratio: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion XL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn fast_sdxl(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/image_to_image/mod.rs new file mode 100644 index 0000000000..3af07e1976 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/image_to_image/mod.rs @@ -0,0 +1,267 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// ControlNet SDXL +/// +/// Category: text-to-image +pub fn image_to_image( + params: ImageToImageControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl-controlnet-canny/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/inpainting/mod.rs new file mode 100644 index 0000000000..72589f2d78 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/inpainting/mod.rs @@ -0,0 +1,267 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// ControlNet SDXL +/// +/// Category: text-to-image +pub fn inpainting( + params: InpaintingControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl-controlnet-canny/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/mod.rs new file mode 100644 index 0000000000..369b764a24 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_sdxl_controlnet_canny/mod.rs @@ -0,0 +1,296 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://avatars.githubusercontent.com/u/74778219" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// ControlNet SDXL +/// +/// Category: text-to-image +pub fn fast_sdxl_controlnet_canny( + params: TextToImageControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-sdxl-controlnet-canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/mod.rs new file mode 100644 index 0000000000..5b839821f4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/mod.rs @@ -0,0 +1,179 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd" + ))) +)] +pub mod text_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// Enabling [DeepCache](https://github.com/horseee/DeepCache) will make the execution + /// faster, but might sometimes degrade overall quality. The higher the setting, the + /// faster the execution will be, but the more quality might be lost. + #[serde(skip_serializing_if = "Option::is_none")] + pub deep_cache: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FastSVDOutput { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDTextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// Enabling [DeepCache](https://github.com/horseee/DeepCache) will make the execution + /// faster, but might sometimes degrade overall quality. The higher the setting, the + /// faster the execution will be, but the more quality might be lost. + #[serde(skip_serializing_if = "Option::is_none")] + pub deep_cache: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The negative prompt to use as a starting point for the generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Stable Video Diffusion +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn fast_svd(params: FastSVDImageInput) -> FalRequest { + FalRequest::new("fal-ai/fast-svd", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/text_to_video/mod.rs new file mode 100644 index 0000000000..8f963f86ce --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd/text_to_video/mod.rs @@ -0,0 +1,164 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// Enabling [DeepCache](https://github.com/horseee/DeepCache) will make the execution + /// faster, but might sometimes degrade overall quality. The higher the setting, the + /// faster the execution will be, but the more quality might be lost. + #[serde(skip_serializing_if = "Option::is_none")] + pub deep_cache: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FastSVDOutput { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDTextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// Enabling [DeepCache](https://github.com/horseee/DeepCache) will make the execution + /// faster, but might sometimes degrade overall quality. The higher the setting, the + /// faster the execution will be, but the more quality might be lost. + #[serde(skip_serializing_if = "Option::is_none")] + pub deep_cache: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The negative prompt to use as a starting point for the generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Stable Video Diffusion +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn text_to_video(params: FastSVDTextInput) -> FalRequest { + FalRequest::new("fal-ai/fast-svd/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/mod.rs new file mode 100644 index 0000000000..b9dac08b03 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/mod.rs @@ -0,0 +1,166 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd-lcm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd-lcm" + ))) +)] +pub mod text_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FastSVDOutput { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDTextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Stable Video Diffusion Turbo +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn fast_svd_lcm(params: FastSVDImageInput) -> FalRequest { + FalRequest::new("fal-ai/fast-svd-lcm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/text_to_video/mod.rs new file mode 100644 index 0000000000..47059b48e3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_svd_lcm/text_to_video/mod.rs @@ -0,0 +1,151 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FastSVDOutput { + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastSVDTextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The FPS of the generated video. The higher the number, the faster the video will + /// play. Total video length is 25 frames. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to run the model for. The higher the number the better + /// the quality and longer it will take to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Stable Video Diffusion Turbo +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn text_to_video(params: FastSVDTextInput) -> FalRequest { + FalRequest::new("fal-ai/fast-svd-lcm/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/image_to_image/mod.rs new file mode 100644 index 0000000000..5c4f9f957c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/image_to_image/mod.rs @@ -0,0 +1,253 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/koala/-CQBCeIxrvPqrvt4FDY5n.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby cat wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby racoon wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion Turbo (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn image_to_image( + params: ImageToImageTurboInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-turbo-diffusion/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/inpainting/mod.rs new file mode 100644 index 0000000000..6adf56f863 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/inpainting/mod.rs @@ -0,0 +1,251 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/koala/-CQBCeIxrvPqrvt4FDY5n.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby cat wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby racoon wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion Turbo (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn inpainting(params: InpaintingTurboInput) -> FalRequest { + FalRequest::new("fal-ai/fast-turbo-diffusion/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/mod.rs new file mode 100644 index 0000000000..d1c205b138 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fast_turbo_diffusion/mod.rs @@ -0,0 +1,282 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/koala/-CQBCeIxrvPqrvt4FDY5n.jpeg" + pub image_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby cat wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The name of the model to use. + /// "stabilityai/sdxl-turbo" + /// "stabilityai/sd-turbo" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A cinematic shot of a baby racoon wearing an intricate italian priest robe." + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion Turbo (v1.5/XL) +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn fast_turbo_diffusion( + params: TextToImageTurboInput, +) -> FalRequest { + FalRequest::new("fal-ai/fast-turbo-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/compose/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/compose/mod.rs new file mode 100644 index 0000000000..8a73fad55d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/compose/mod.rs @@ -0,0 +1,220 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Audio { + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Type of media (always 'audio') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Audio sample rate in Hz + pub sample_rate: i64, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioTrack { + /// Audio bitrate in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Audio codec used (e.g., 'aac', 'mp3') + pub codec: String, + /// Audio sample rate in Hz + pub sample_rate: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// List of tracks to be combined into the final media + pub tracks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Keyframe { + /// The duration in milliseconds of this keyframe + pub duration: f64, + /// The timestamp in milliseconds where this keyframe starts + pub timestamp: f64, + /// The URL where this keyframe's media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MetadataInput { + /// Whether to extract the start and end frames for videos. Note that when true the request will be slower. + #[serde(skip_serializing_if = "Option::is_none")] + pub extract_frames: Option, + /// URL of the media file (video or audio) to analyze + pub media_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MetadataOutput { + /// Metadata for the analyzed media file (either Video or Audio) + pub media: MediaProperty, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URL of the video's thumbnail image + pub thumbnail_url: String, + /// URL of the processed video file + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Resolution { + /// Display aspect ratio (e.g., '16:9') + pub aspect_ratio: String, + /// Height of the video in pixels + pub height: i64, + /// Width of the video in pixels + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Track { + /// Unique identifier for the track + pub id: String, + /// List of keyframes that make up this track + pub keyframes: Vec, + /// Type of track ('video' or 'audio') + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Video { + /// Audio track information if video has audio + #[serde(skip_serializing_if = "Option::is_none")] + pub audio: Option>, + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// URL of the extracted last frame + #[serde(skip_serializing_if = "Option::is_none")] + pub end_frame_url: Option, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Detailed video format information + pub format: VideoFormat, + /// Frames per second + pub fps: i64, + /// Total number of frames in the video + pub frame_count: i64, + /// Type of media (always 'video') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Video resolution information + pub resolution: Resolution, + /// URL of the extracted first frame + #[serde(skip_serializing_if = "Option::is_none")] + pub start_frame_url: Option, + /// Time base used for frame timestamps + pub timebase: String, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoFormat { + /// Video bitrate in bits per second + pub bitrate: i64, + /// Container format of the video + pub container: String, + /// Codec level (e.g., 4.1) + pub level: f64, + /// Pixel format used (e.g., 'yuv420p') + pub pixel_format: String, + /// Codec profile (e.g., 'main', 'high') + pub profile: String, + /// Video codec used (e.g., 'h264') + pub video_codec: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WaveformInput { + /// URL of the audio file to analyze + pub media_url: String, + /// Controls how many points are sampled per second of audio. Lower values (e.g. 1-2) create a coarser waveform, higher values (e.g. 4-10) create a more detailed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_second: Option, + /// Number of decimal places for the waveform values. Higher values provide more precision but increase payload size. + #[serde(skip_serializing_if = "Option::is_none")] + pub precision: Option, + /// Size of the smoothing window. Higher values create a smoother waveform. Must be an odd number. + #[serde(skip_serializing_if = "Option::is_none")] + pub smoothing_window: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WaveformOutput { + /// Duration of the audio in seconds + pub duration: f64, + /// Number of points in the waveform data + pub points: i64, + /// Number of decimal places used in the waveform values + pub precision: i64, + /// Normalized waveform data as an array of values between -1 and 1. The number of points is determined by audio duration × points_per_second. + pub waveform: Vec, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum MediaProperty { + #[default] + Video(Video), + Audio(Audio), +} + +/// FFmpeg API Compose +/// +/// Category: video-to-video +/// Machine Type: L +pub fn compose(params: Input) -> FalRequest { + FalRequest::new("fal-ai/ffmpeg-api/compose", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/metadata/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/metadata/mod.rs new file mode 100644 index 0000000000..99977bbe3a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/metadata/mod.rs @@ -0,0 +1,220 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Audio { + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Type of media (always 'audio') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Audio sample rate in Hz + pub sample_rate: i64, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioTrack { + /// Audio bitrate in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Audio codec used (e.g., 'aac', 'mp3') + pub codec: String, + /// Audio sample rate in Hz + pub sample_rate: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// List of tracks to be combined into the final media + pub tracks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Keyframe { + /// The duration in milliseconds of this keyframe + pub duration: f64, + /// The timestamp in milliseconds where this keyframe starts + pub timestamp: f64, + /// The URL where this keyframe's media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MetadataInput { + /// Whether to extract the start and end frames for videos. Note that when true the request will be slower. + #[serde(skip_serializing_if = "Option::is_none")] + pub extract_frames: Option, + /// URL of the media file (video or audio) to analyze + pub media_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MetadataOutput { + /// Metadata for the analyzed media file (either Video or Audio) + pub media: MediaProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// URL of the video's thumbnail image + pub thumbnail_url: String, + /// URL of the processed video file + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Resolution { + /// Display aspect ratio (e.g., '16:9') + pub aspect_ratio: String, + /// Height of the video in pixels + pub height: i64, + /// Width of the video in pixels + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Track { + /// Unique identifier for the track + pub id: String, + /// List of keyframes that make up this track + pub keyframes: Vec, + /// Type of track ('video' or 'audio') + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Video { + /// Audio track information if video has audio + #[serde(skip_serializing_if = "Option::is_none")] + pub audio: Option>, + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// URL of the extracted last frame + #[serde(skip_serializing_if = "Option::is_none")] + pub end_frame_url: Option, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Detailed video format information + pub format: VideoFormat, + /// Frames per second + pub fps: i64, + /// Total number of frames in the video + pub frame_count: i64, + /// Type of media (always 'video') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Video resolution information + pub resolution: Resolution, + /// URL of the extracted first frame + #[serde(skip_serializing_if = "Option::is_none")] + pub start_frame_url: Option, + /// Time base used for frame timestamps + pub timebase: String, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoFormat { + /// Video bitrate in bits per second + pub bitrate: i64, + /// Container format of the video + pub container: String, + /// Codec level (e.g., 4.1) + pub level: f64, + /// Pixel format used (e.g., 'yuv420p') + pub pixel_format: String, + /// Codec profile (e.g., 'main', 'high') + pub profile: String, + /// Video codec used (e.g., 'h264') + pub video_codec: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WaveformInput { + /// URL of the audio file to analyze + pub media_url: String, + /// Controls how many points are sampled per second of audio. Lower values (e.g. 1-2) create a coarser waveform, higher values (e.g. 4-10) create a more detailed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_second: Option, + /// Number of decimal places for the waveform values. Higher values provide more precision but increase payload size. + #[serde(skip_serializing_if = "Option::is_none")] + pub precision: Option, + /// Size of the smoothing window. Higher values create a smoother waveform. Must be an odd number. + #[serde(skip_serializing_if = "Option::is_none")] + pub smoothing_window: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WaveformOutput { + /// Duration of the audio in seconds + pub duration: f64, + /// Number of points in the waveform data + pub points: i64, + /// Number of decimal places used in the waveform values + pub precision: i64, + /// Normalized waveform data as an array of values between -1 and 1. The number of points is determined by audio duration × points_per_second. + pub waveform: Vec, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum MediaProperty { + #[default] + Video(Video), + Audio(Audio), +} + +/// FFmpeg API Compose +/// +/// Category: video-to-video +/// Machine Type: L +pub fn metadata(params: MetadataInput) -> FalRequest { + FalRequest::new("fal-ai/ffmpeg-api/metadata", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/mod.rs new file mode 100644 index 0000000000..674783ce7f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" + ))) +)] +pub mod compose; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" + ))) +)] +pub mod metadata; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" + ))) +)] +pub mod waveform; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/waveform/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/waveform/mod.rs new file mode 100644 index 0000000000..c5423c5846 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ffmpeg_api/waveform/mod.rs @@ -0,0 +1,220 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Audio { + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Type of media (always 'audio') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Audio sample rate in Hz + pub sample_rate: i64, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioTrack { + /// Audio bitrate in bits per second + pub bitrate: i64, + /// Number of audio channels + pub channels: i64, + /// Audio codec used (e.g., 'aac', 'mp3') + pub codec: String, + /// Audio sample rate in Hz + pub sample_rate: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// List of tracks to be combined into the final media + pub tracks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Keyframe { + /// The duration in milliseconds of this keyframe + pub duration: f64, + /// The timestamp in milliseconds where this keyframe starts + pub timestamp: f64, + /// The URL where this keyframe's media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MetadataInput { + /// Whether to extract the start and end frames for videos. Note that when true the request will be slower. + #[serde(skip_serializing_if = "Option::is_none")] + pub extract_frames: Option, + /// URL of the media file (video or audio) to analyze + pub media_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MetadataOutput { + /// Metadata for the analyzed media file (either Video or Audio) + pub media: MediaProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// URL of the video's thumbnail image + pub thumbnail_url: String, + /// URL of the processed video file + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Resolution { + /// Display aspect ratio (e.g., '16:9') + pub aspect_ratio: String, + /// Height of the video in pixels + pub height: i64, + /// Width of the video in pixels + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Track { + /// Unique identifier for the track + pub id: String, + /// List of keyframes that make up this track + pub keyframes: Vec, + /// Type of track ('video' or 'audio') + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Video { + /// Audio track information if video has audio + #[serde(skip_serializing_if = "Option::is_none")] + pub audio: Option>, + /// Overall bitrate of the media in bits per second + pub bitrate: i64, + /// Codec used to encode the media + pub codec: String, + /// Container format of the media file (e.g., 'mp4', 'mov') + pub container: String, + /// MIME type of the media file + pub content_type: String, + /// Duration of the media in seconds + pub duration: f64, + /// URL of the extracted last frame + #[serde(skip_serializing_if = "Option::is_none")] + pub end_frame_url: Option, + /// Original filename of the media + pub file_name: String, + /// Size of the file in bytes + pub file_size: i64, + /// Detailed video format information + pub format: VideoFormat, + /// Frames per second + pub fps: i64, + /// Total number of frames in the video + pub frame_count: i64, + /// Type of media (always 'video') + #[serde(skip_serializing_if = "Option::is_none")] + pub media_type: Option, + /// Video resolution information + pub resolution: Resolution, + /// URL of the extracted first frame + #[serde(skip_serializing_if = "Option::is_none")] + pub start_frame_url: Option, + /// Time base used for frame timestamps + pub timebase: String, + /// URL where the media file can be accessed + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoFormat { + /// Video bitrate in bits per second + pub bitrate: i64, + /// Container format of the video + pub container: String, + /// Codec level (e.g., 4.1) + pub level: f64, + /// Pixel format used (e.g., 'yuv420p') + pub pixel_format: String, + /// Codec profile (e.g., 'main', 'high') + pub profile: String, + /// Video codec used (e.g., 'h264') + pub video_codec: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WaveformInput { + /// URL of the audio file to analyze + pub media_url: String, + /// Controls how many points are sampled per second of audio. Lower values (e.g. 1-2) create a coarser waveform, higher values (e.g. 4-10) create a more detailed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_second: Option, + /// Number of decimal places for the waveform values. Higher values provide more precision but increase payload size. + #[serde(skip_serializing_if = "Option::is_none")] + pub precision: Option, + /// Size of the smoothing window. Higher values create a smoother waveform. Must be an odd number. + #[serde(skip_serializing_if = "Option::is_none")] + pub smoothing_window: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WaveformOutput { + /// Duration of the audio in seconds + pub duration: f64, + /// Number of points in the waveform data + pub points: i64, + /// Number of decimal places used in the waveform values + pub precision: i64, + /// Normalized waveform data as an array of values between -1 and 1. The number of points is determined by audio duration × points_per_second. + pub waveform: Vec, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum MediaProperty { + #[default] + Video(Video), + Audio(Audio), +} + +/// FFmpeg API Compose +/// +/// Category: video-to-video +/// Machine Type: L +pub fn waveform(params: WaveformInput) -> FalRequest { + FalRequest::new("fal-ai/ffmpeg-api/waveform", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption/mod.rs new file mode 100644 index 0000000000..5161f7d363 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn caption(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/caption", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption_to_phrase_grounding/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption_to_phrase_grounding/mod.rs new file mode 100644 index 0000000000..7bc9ada825 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/caption_to_phrase_grounding/mod.rs @@ -0,0 +1,191 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn caption_to_phrase_grounding( + params: ImageWithTextInput, +) -> FalRequest { + FalRequest::new( + "fal-ai/florence-2-large/caption-to-phrase-grounding", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/dense_region_caption/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/dense_region_caption/mod.rs new file mode 100644 index 0000000000..ac203140ad --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/dense_region_caption/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn dense_region_caption( + params: ImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/dense-region-caption", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/detailed_caption/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/detailed_caption/mod.rs new file mode 100644 index 0000000000..d9c1ba1291 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/detailed_caption/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn detailed_caption(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/detailed-caption", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/mod.rs new file mode 100644 index 0000000000..766e7767fb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/mod.rs @@ -0,0 +1,196 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod caption; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod caption_to_phrase_grounding; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod dense_region_caption; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod detailed_caption; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod more_detailed_caption; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod object_detection; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod ocr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod ocr_with_region; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod open_vocabulary_detection; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod referring_expression_segmentation; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod region_proposal; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod region_to_category; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod region_to_description; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod region_to_segmentation; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/more_detailed_caption/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/more_detailed_caption/mod.rs new file mode 100644 index 0000000000..452ac1b35f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/more_detailed_caption/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn more_detailed_caption(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/more-detailed-caption", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/object_detection/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/object_detection/mod.rs new file mode 100644 index 0000000000..e936e0ad5b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/object_detection/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn object_detection(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/object-detection", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr/mod.rs new file mode 100644 index 0000000000..d730bb2a61 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn ocr(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/ocr", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr_with_region/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr_with_region/mod.rs new file mode 100644 index 0000000000..1fb5173221 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/ocr_with_region/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn ocr_with_region( + params: ImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/ocr-with-region", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/open_vocabulary_detection/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/open_vocabulary_detection/mod.rs new file mode 100644 index 0000000000..c1cb26091e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/open_vocabulary_detection/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn open_vocabulary_detection( + params: ImageWithTextInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/open-vocabulary-detection", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/referring_expression_segmentation/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/referring_expression_segmentation/mod.rs new file mode 100644 index 0000000000..36cf7c452a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/referring_expression_segmentation/mod.rs @@ -0,0 +1,191 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn referring_expression_segmentation( + params: ImageWithTextInput, +) -> FalRequest { + FalRequest::new( + "fal-ai/florence-2-large/referring-expression-segmentation", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_proposal/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_proposal/mod.rs new file mode 100644 index 0000000000..30996397be --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_proposal/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn region_proposal(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/region-proposal", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_category/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_category/mod.rs new file mode 100644 index 0000000000..d24a823292 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_category/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn region_to_category( + params: ImageWithUserCoordinatesInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/region-to-category", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_description/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_description/mod.rs new file mode 100644 index 0000000000..4b0a56cc85 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_description/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn region_to_description( + params: ImageWithUserCoordinatesInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/region-to-description", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_segmentation/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_segmentation/mod.rs new file mode 100644 index 0000000000..6a97bc6b95 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/florence_2_large/region_to_segmentation/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBox { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: BoundingBoxes, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoundingBoxes { + /// List of bounding boxes + pub bboxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithTextInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// Text input for the task + pub text_input: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageWithUserCoordinatesInput { + /// The URL of the image to be processed. + /// "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg" + /// "http://ecx.images-amazon.com/images/I/51UUzBDAMsL.jpg" + pub image_url: String, + /// The user input coordinates + /// {"x1":100,"x2":200,"y1":100,"y2":200} + pub region: Region, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBox { + /// List of quadrilateral boxes + pub quad_boxes: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: OCRBoundingBox, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OCRBoundingBoxSingle { + /// Height of the bounding box + pub h: f64, + /// Label of the bounding box + pub label: String, + /// Width of the bounding box + pub w: f64, + /// X-coordinate of the top-left corner + pub x: f64, + /// Y-coordinate of the top-left corner + pub y: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Polygon { + /// Label of the polygon + pub label: String, + /// List of points + pub points: Vec>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PolygonOutput { + /// List of polygons + pub polygons: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PolygonOutputWithLabels { + /// Processed image + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// Results from the model + pub results: PolygonOutput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Region { + /// X-coordinate of the top-left corner + pub x1: i64, + /// X-coordinate of the bottom-right corner + pub x2: i64, + /// Y-coordinate of the top-left corner + pub y1: i64, + /// Y-coordinate of the bottom-right corner + pub y2: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// Results from the model + pub results: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Florence-2 Large +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn region_to_segmentation( + params: ImageWithUserCoordinatesInput, +) -> FalRequest { + FalRequest::new("fal-ai/florence-2-large/region-to-segmentation", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flowedit/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flowedit/mod.rs new file mode 100644 index 0000000000..244471dae8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flowedit/mod.rs @@ -0,0 +1,101 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FlowEditInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/model_tests/FlowEdit/lighthouse.png" + pub image_url: String, + /// Average step count + #[serde(skip_serializing_if = "Option::is_none")] + pub n_avg: Option, + /// Control the strength of the edit + #[serde(skip_serializing_if = "Option::is_none")] + pub n_max: Option, + /// Minimum step for improved style edits + #[serde(skip_serializing_if = "Option::is_none")] + pub n_min: Option, + /// Steps for which the model should run. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Random seed for reproducible generation. If set none, a random seed will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Prompt of the image to be used. + /// "The image features a tall white lighthouse standing prominently\n on a hill, with a beautiful blue sky in the background. The lighthouse is illuminated\n by a bright light, making it a prominent landmark in the scene." + pub source_prompt: String, + /// Guidance scale for the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub src_guidance_scale: Option, + /// Guidance scale for target. + #[serde(skip_serializing_if = "Option::is_none")] + pub tar_guidance_scale: Option, + /// Prompt of the image to be made. + /// "The image features Big ben clock tower standing prominently\n on a hill, with a beautiful blue sky in the background. The Big ben clock tower is illuminated\n by a bright light, making it a prominent landmark in the scene." + pub target_prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FlowEditOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/FlowEdit/aa5c3d028ad04800a54f70f928198d91.png","width":1024} + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Flow-Edit +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn flowedit(params: FlowEditInput) -> FalRequest { + FalRequest::new("fal-ai/flowedit", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/image_to_image/mod.rs new file mode 100644 index 0000000000..3e35d898ce --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/image_to_image/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// Image to image version of FLUX.1 [dev], next generation image-to-image model. +pub fn image_to_image(params: DevImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux/dev/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/mod.rs new file mode 100644 index 0000000000..db18c86818 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/mod.rs @@ -0,0 +1,274 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn dev(params: DevTextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux/dev", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/redux/mod.rs new file mode 100644 index 0000000000..3e6963bae0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/dev/redux/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Redux [dev], remix your images with the state-of-the-art FLUX model. +pub fn redux(params: DevReduxInput) -> FalRequest { + FalRequest::new("fal-ai/flux/dev/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/mod.rs new file mode 100644 index 0000000000..f6d8e7b3d6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/mod.rs @@ -0,0 +1,274 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod dev; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod schnell; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux(params: DevTextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/mod.rs new file mode 100644 index 0000000000..52339f2269 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/mod.rs @@ -0,0 +1,260 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [schnell], turbo mode for next generation text-to-image model FLUX. +pub fn schnell(params: SchnellTextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux/schnell", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/redux/mod.rs new file mode 100644 index 0000000000..694daa0310 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux/schnell/redux/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Redux [schnell], remix your images at turbo-speed with FLUX model. +pub fn redux(params: SchnellReduxInput) -> FalRequest { + FalRequest::new("fal-ai/flux/schnell/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/image_to_image/mod.rs new file mode 100644 index 0000000000..9766b96880 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/image_to_image/mod.rs @@ -0,0 +1,198 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Control LoRA Canny +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-control-lora-canny/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/mod.rs new file mode 100644 index 0000000000..56170fb57d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_canny/mod.rs @@ -0,0 +1,213 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-canny" + ))) +)] +pub mod image_to_image; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Control LoRA Canny +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_control_lora_canny(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-control-lora-canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/image_to_image/mod.rs new file mode 100644 index 0000000000..0bbb194c2b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/image_to_image/mod.rs @@ -0,0 +1,198 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Control LoRA Depth +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-control-lora-depth/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/mod.rs new file mode 100644 index 0000000000..b4cadd04ff --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_control_lora_depth/mod.rs @@ -0,0 +1,213 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-depth" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-depth" + ))) +)] +pub mod image_to_image; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The image to use for control lora. This is used to control the style of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_image_url: Option, + /// The strength of the control lora. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_lora_strength: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Control LoRA Depth +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_control_lora_depth(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-control-lora-depth", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_differential_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_differential_diffusion/mod.rs new file mode 100644 index 0000000000..892ea2e213 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_differential_diffusion/mod.rs @@ -0,0 +1,97 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DiffInput { + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for image-to-image. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Differential Diffusion +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn flux_differential_diffusion(params: DiffInput) -> FalRequest { + FalRequest::new("fal-ai/flux-differential-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/differential_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/differential_diffusion/mod.rs new file mode 100644 index 0000000000..cf26a45688 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/differential_diffusion/mod.rs @@ -0,0 +1,661 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlLoraWeight { + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// URL or the path to the LoRA weights. + pub path: String, + /// Type of preprocessing to apply to the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnion { + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The control images and modes to use for the control net. + pub controls: Vec, + /// URL or the path to the control net weights. + pub path: String, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnionInput { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// Control Mode for Flux Controlnet Union. Supported values are: + /// - canny: Uses the edges for guided generation. + /// - tile: Uses the tiles for guided generation. + /// - depth: Utilizes a grayscale depth map for guided generation. + /// - blur: Adds a blur to the image. + /// - pose: Uses the pose of the image for guided generation. + /// - gray: Converts the image to grayscale. + /// - low-quality: Converts the image to a low-quality image. + pub control_mode: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DifferentialDiffusionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for differential diffusion. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RFInversionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controller guidance (gamma) used in the creation of structured noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_forward: Option, + /// The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_reverse: Option, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be edited + /// "https://storage.googleapis.com/falserverless/flux-general-tests/anime_style.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to edit the image with + /// "Wearing glasses" + pub prompt: String, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// Timestep to stop guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_end: Option, + /// Scheduler for applying reverse guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_schedule: Option, + /// Timestep to start guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_start: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ScaleProperty { + #[default] + Object(HashMap), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with Controlnets and Loras +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn differential_diffusion( + params: DifferentialDiffusionInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-general/differential-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/image_to_image/mod.rs new file mode 100644 index 0000000000..2a6aef2f90 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/image_to_image/mod.rs @@ -0,0 +1,659 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlLoraWeight { + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// URL or the path to the LoRA weights. + pub path: String, + /// Type of preprocessing to apply to the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnion { + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The control images and modes to use for the control net. + pub controls: Vec, + /// URL or the path to the control net weights. + pub path: String, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnionInput { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// Control Mode for Flux Controlnet Union. Supported values are: + /// - canny: Uses the edges for guided generation. + /// - tile: Uses the tiles for guided generation. + /// - depth: Utilizes a grayscale depth map for guided generation. + /// - blur: Adds a blur to the image. + /// - pose: Uses the pose of the image for guided generation. + /// - gray: Converts the image to grayscale. + /// - low-quality: Converts the image to a low-quality image. + pub control_mode: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DifferentialDiffusionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for differential diffusion. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RFInversionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controller guidance (gamma) used in the creation of structured noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_forward: Option, + /// The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_reverse: Option, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be edited + /// "https://storage.googleapis.com/falserverless/flux-general-tests/anime_style.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to edit the image with + /// "Wearing glasses" + pub prompt: String, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// Timestep to stop guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_end: Option, + /// Scheduler for applying reverse guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_schedule: Option, + /// Timestep to start guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_start: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ScaleProperty { + #[default] + Object(HashMap), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with Controlnets and Loras +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-general/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/inpainting/mod.rs new file mode 100644 index 0000000000..2340d411f7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/inpainting/mod.rs @@ -0,0 +1,659 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlLoraWeight { + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// URL or the path to the LoRA weights. + pub path: String, + /// Type of preprocessing to apply to the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnion { + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The control images and modes to use for the control net. + pub controls: Vec, + /// URL or the path to the control net weights. + pub path: String, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnionInput { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// Control Mode for Flux Controlnet Union. Supported values are: + /// - canny: Uses the edges for guided generation. + /// - tile: Uses the tiles for guided generation. + /// - depth: Utilizes a grayscale depth map for guided generation. + /// - blur: Adds a blur to the image. + /// - pose: Uses the pose of the image for guided generation. + /// - gray: Converts the image to grayscale. + /// - low-quality: Converts the image to a low-quality image. + pub control_mode: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DifferentialDiffusionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for differential diffusion. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RFInversionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controller guidance (gamma) used in the creation of structured noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_forward: Option, + /// The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_reverse: Option, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be edited + /// "https://storage.googleapis.com/falserverless/flux-general-tests/anime_style.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to edit the image with + /// "Wearing glasses" + pub prompt: String, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// Timestep to stop guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_end: Option, + /// Scheduler for applying reverse guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_schedule: Option, + /// Timestep to start guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_start: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ScaleProperty { + #[default] + Object(HashMap), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with Controlnets and Loras +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn inpainting(params: InpaintInput) -> FalRequest { + FalRequest::new("fal-ai/flux-general/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/mod.rs new file mode 100644 index 0000000000..9fe6c702ac --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/mod.rs @@ -0,0 +1,716 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" + ))) +)] +pub mod differential_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" + ))) +)] +pub mod inpainting; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" + ))) +)] +pub mod rf_inversion; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlLoraWeight { + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// URL or the path to the LoRA weights. + pub path: String, + /// Type of preprocessing to apply to the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnion { + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The control images and modes to use for the control net. + pub controls: Vec, + /// URL or the path to the control net weights. + pub path: String, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnionInput { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// Control Mode for Flux Controlnet Union. Supported values are: + /// - canny: Uses the edges for guided generation. + /// - tile: Uses the tiles for guided generation. + /// - depth: Utilizes a grayscale depth map for guided generation. + /// - blur: Adds a blur to the image. + /// - pose: Uses the pose of the image for guided generation. + /// - gray: Converts the image to grayscale. + /// - low-quality: Converts the image to a low-quality image. + pub control_mode: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DifferentialDiffusionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for differential diffusion. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RFInversionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controller guidance (gamma) used in the creation of structured noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_forward: Option, + /// The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_reverse: Option, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be edited + /// "https://storage.googleapis.com/falserverless/flux-general-tests/anime_style.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to edit the image with + /// "Wearing glasses" + pub prompt: String, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// Timestep to stop guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_end: Option, + /// Scheduler for applying reverse guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_schedule: Option, + /// Timestep to start guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_start: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ScaleProperty { + #[default] + Object(HashMap), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with Controlnets and Loras +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_general(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-general", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/rf_inversion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/rf_inversion/mod.rs new file mode 100644 index 0000000000..3df5ad76ec --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_general/rf_inversion/mod.rs @@ -0,0 +1,659 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlLoraWeight { + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// URL or the path to the LoRA weights. + pub path: String, + /// Type of preprocessing to apply to the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnion { + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The control images and modes to use for the control net. + pub controls: Vec, + /// URL or the path to the control net weights. + pub path: String, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNetUnionInput { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// Control Mode for Flux Controlnet Union. Supported values are: + /// - canny: Uses the edges for guided generation. + /// - tile: Uses the tiles for guided generation. + /// - depth: Utilizes a grayscale depth map for guided generation. + /// - blur: Adds a blur to the image. + /// - pose: Uses the pose of the image for guided generation. + /// - gray: Converts the image to grayscale. + /// - low-quality: Converts the image to a low-quality image. + pub control_mode: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DifferentialDiffusionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// URL of change map. + /// "https://fal.media/files/zebra/Wh4IYAiAAcVbuZ8M9ZMSn.jpeg" + pub change_map_image_url: String, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use as initial image. + /// "https://fal.media/files/koala/h6a7KK2Ie_inuGbdartoX.jpeg" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Tree of life under the sea, ethereal, glittering, lens flares, cinematic lighting, artwork by Anna Dittmann & Carne Griffiths, 8k, unreal engine 5, hightly detailed, intricate detailed." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for differential diffusion. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RFInversionInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controller guidance (gamma) used in the creation of structured noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_forward: Option, + /// The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input. + #[serde(skip_serializing_if = "Option::is_none")] + pub controller_guidance_reverse: Option, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be edited + /// "https://storage.googleapis.com/falserverless/flux-general-tests/anime_style.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to edit the image with + /// "Wearing glasses" + pub prompt: String, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// Timestep to stop guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_end: Option, + /// Scheduler for applying reverse guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_schedule: Option, + /// Timestep to start guidance during reverse process. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_guidance_start: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Base shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub base_shift: Option, + /// The LoRAs to use for the image generation which use a control image. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub control_loras: Option>>, + /// The controlnet unions to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_unions: Option>>, + /// The controlnets to use for the image generation. Only one controlnet is supported at the moment. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapters: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Max shift for the scheduled timesteps + #[serde(skip_serializing_if = "Option::is_none")] + pub max_shift: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub real_cfg_scale: Option, + /// The percentage of the total timesteps when the reference guidance is to be ended. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_end: Option, + /// URL of Image for Reference-Only + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_image_url: Option, + /// The percentage of the total timesteps when the reference guidance is to bestarted. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_start: Option, + /// Strength of reference_only generation. Only used if a reference image is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_strength: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Specifies whether beta sigmas ought to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_beta_schedule: Option, + /// Uses classical CFG as in SD1.5, SDXL, etc. Increases generation times and price when set to be true. + /// If using XLabs IP-Adapter v1, this will be turned on!. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_real_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ScaleProperty { + #[default] + Object(HashMap), + Number(f64), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with Controlnets and Loras +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn rf_inversion(params: RFInversionInput) -> FalRequest { + FalRequest::new("fal-ai/flux-general/rf-inversion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/image_to_image/mod.rs new file mode 100644 index 0000000000..61b9419bfb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/image_to_image/mod.rs @@ -0,0 +1,235 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with LoRAs +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/inpainting/mod.rs new file mode 100644 index 0000000000..602d584e76 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/inpainting/mod.rs @@ -0,0 +1,235 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with LoRAs +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn inpainting(params: InpaintInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/mod.rs new file mode 100644 index 0000000000..a572058ab5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora/mod.rs @@ -0,0 +1,264 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] with LoRAs +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_lora(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_canny/mod.rs new file mode 100644 index 0000000000..0d0c564d29 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_canny/mod.rs @@ -0,0 +1,143 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for canny input + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blue owl." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Canny with LoRAs +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_lora_canny(params: CannyInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora-canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_depth/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_depth/mod.rs new file mode 100644 index 0000000000..e37025f318 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_depth/mod.rs @@ -0,0 +1,143 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for depth input + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Black hole in space, orange accretion disc" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Depth with LoRAs +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_lora_depth(params: DepthInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora-depth", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fast_training/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fast_training/mod.rs new file mode 100644 index 0000000000..4c3279042d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fast_training/mod.rs @@ -0,0 +1,105 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URL to the training configuration file. + pub config_file: File, + /// URL to the preprocessed images. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_preprocessed_output: Option>, + /// URL to the trained diffusers lora weights. + pub diffusers_lora_file: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PublicInput { + /// If True segmentation masks will be used in the weight the training loss. For people a face mask is used if possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub create_masks: Option, + /// The format of the archive. If not specified, the format will be inferred from the URL. + #[serde(skip_serializing_if = "Option::is_none")] + pub data_archive_format: Option, + /// URL to zip archive with images. Try to use at least 4 images in general the more the better. + /// + /// In addition to images the archive can contain text files with captions. Each text file should have the same name as the image file it corresponds to. + pub images_data_url: String, + /// Specifies whether the input data is already in a processed format. When set to False (default), the system expects raw input where image files and their corresponding caption files share the same name (e.g., 'photo.jpg' and 'photo.txt'). Set to True if your data is already in a preprocessed format. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_input_format_already_preprocessed: Option, + /// If True, the training will be for a style. This will deactivate segmentation, captioning and will use trigger word instead. Use the trigger word to specify the style. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_style: Option, + /// Number of steps to train the LoRA on. + /// 1000 + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// Trigger word to be used in the captions. If None, a trigger word will not be used. + /// If no captions are provide the trigger_word will be used instead of captions. If captions are the trigger word will not be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub trigger_word: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Train Flux LoRA +/// +/// Category: training +/// Machine Type: A100 +/// +/// +/// FLUX LoRA fine-tuning endpoint. +/// +/// This endpoint fine-tunes a LoRA model on a dataset of images. +/// By default the fine-tuning process is configured for preprocessing a subject. +/// The training will generate both segmentation masks and caption for training. +/// +/// If the `is_style` flag is set to `True`, +/// the training a style LoRA, which disables auto-captioning and sengmentation. +/// +/// To provide your own captions, you can include a text file with the same name as +/// the image file. For example, if you have an image `photo.jpg`, you can include a +/// text file `photo.txt` with the caption. +/// +/// Additionally you can include your own masks for the images. If you have a image +/// `photo.jpg`, you can include a mask file `photo_mask.jpg`. +pub fn flux_lora_fast_training(params: PublicInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora-fast-training", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fill/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fill/mod.rs new file mode 100644 index 0000000000..e486c6076e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_fill/mod.rs @@ -0,0 +1,177 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FillInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Use an image fill input to fill in particular images into the masked area. + #[serde(skip_serializing_if = "Option::is_none")] + pub fill_image: Option>, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for fill operation + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Specifies whether to paste-back the original image onto to the non-inpainted areas of the output + #[serde(skip_serializing_if = "Option::is_none")] + pub paste_back: Option, + /// The prompt to generate an image from. + /// "A knight in shining armour holding a greatshield with 'FAL' on it" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Resizes the image back to the original size. Use when you wish to preserve the exact image size as the originally provided image. + #[serde(skip_serializing_if = "Option::is_none")] + pub resize_to_original: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageFillInput { + /// URLs of images to be filled into the masked area. + #[serde(skip_serializing_if = "Option::is_none")] + pub fill_image_url: Option, + /// Uses the provided fill image in context with the base image to fill in more faithfully. Will increase price. + #[serde(skip_serializing_if = "Option::is_none")] + pub in_context_fill: Option, + /// Whether to use the prompt as well in the generation, along with the redux image. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FillImageUrlProperty { + #[default] + Array(Vec), + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 [dev] Fill with LoRAs +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn flux_lora_fill(params: FillInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora-fill", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_portrait_trainer/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_portrait_trainer/mod.rs new file mode 100644 index 0000000000..7236ed8b9f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_lora_portrait_trainer/mod.rs @@ -0,0 +1,93 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URL to the training configuration file. + pub config_file: File, + /// URL to the trained diffusers lora weights. + pub diffusers_lora_file: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PublicInput { + /// The format of the archive. If not specified, the format will be inferred from the URL. + #[serde(skip_serializing_if = "Option::is_none")] + pub data_archive_format: Option, + /// URL to zip archive with images of a consistent style. Try to use at least 10 images, although more is better. + /// + /// In addition to images the archive can contain text files with captions. Each text file should have the same name as the image file it corresponds to. + /// + /// The captions can include a special string `[trigger]`. If a trigger_word is specified, it will replace `[trigger]` in the captions. + pub images_data_url: String, + /// Learning rate to use for training. + /// 0.0002 + #[serde(skip_serializing_if = "Option::is_none")] + pub learning_rate: Option, + /// If True, multiresolution training will be used. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub multiresolution_training: Option, + /// URL to a checkpoint to resume training from. + #[serde(skip_serializing_if = "Option::is_none")] + pub resume_from_checkpoint: Option, + /// Number of steps to train the LoRA on. + /// 1000 + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, + /// If True, the subject will be cropped from the image. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub subject_crop: Option, + /// Trigger phrase to be used in the captions. If None, a trigger word will not be used. + /// If no captions are provide the trigger_work will be used instead of captions. If captions are provided, the trigger word will replace the `[trigger]` string in the captions. + #[serde(skip_serializing_if = "Option::is_none")] + pub trigger_phrase: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Train Flux LoRAs For Portraits +/// +/// Category: training +/// Machine Type: H100 +pub fn flux_lora_portrait_trainer(params: PublicInput) -> FalRequest { + FalRequest::new("fal-ai/flux-lora-portrait-trainer", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/finetuned/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/finetuned/mod.rs new file mode 100644 index 0000000000..380b64f88e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/finetuned/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [pro], next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn finetuned( + params: FluxProTextToImageFinetunedInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/finetuned", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/mod.rs new file mode 100644 index 0000000000..f2c11cd968 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/mod.rs @@ -0,0 +1,733 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod finetuned; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod new; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod v1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod v1_1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod v1_1_ultra; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod v1_1_ultra_finetuned; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [pro], next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn flux_pro(params: FluxProTextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/new/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/new/mod.rs new file mode 100644 index 0000000000..9fcff063b3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/new/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 [pro], next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn new(params: FluxProTextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/new", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny/mod.rs new file mode 100644 index 0000000000..b5d1618724 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Canny Control [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn canny(params: FluxProCannyControlInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny_finetuned/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny_finetuned/mod.rs new file mode 100644 index 0000000000..e25e55f609 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/canny_finetuned/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Canny Control [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn canny_finetuned( + params: FluxProCannyControlFinetunedInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/canny-finetuned", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth/mod.rs new file mode 100644 index 0000000000..04c07571e7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Depth Control [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn depth(params: FluxProDepthControlInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/depth", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth_finetuned/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth_finetuned/mod.rs new file mode 100644 index 0000000000..dcb1eda156 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/depth_finetuned/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Depth Control [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn depth_finetuned( + params: FluxProDepthControlFinetunedInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/depth-finetuned", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill/mod.rs new file mode 100644 index 0000000000..7df9744398 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Fill [pro] API, next generation inpainting/outpainting model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn fill(params: FluxProFillInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/fill", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill_finetuned/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill_finetuned/mod.rs new file mode 100644 index 0000000000..feccdd139b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/fill_finetuned/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Fill [pro] API, next generation inpainting/outpainting model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn fill_finetuned( + params: FluxProFillFinetunedInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/fill-finetuned", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/mod.rs new file mode 100644 index 0000000000..c07c6c4868 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/mod.rs @@ -0,0 +1,112 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod canny_finetuned; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod depth; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod depth_finetuned; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod fill; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod fill_finetuned; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod outpaint; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod redux; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/outpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/outpaint/mod.rs new file mode 100644 index 0000000000..92bda49848 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/outpaint/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Outpaint [pro] API, expand images in any direction using outpainting. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn outpaint(params: FluxProOutpaintInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/outpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/redux/mod.rs new file mode 100644 index 0000000000..f789c83026 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1/redux/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX.1 Redux [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn redux(params: FluxProRedux) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/mod.rs new file mode 100644 index 0000000000..9d57de7d21 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/mod.rs @@ -0,0 +1,665 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX1.1 [pro], next generation text-to-image model, with 10x accelerated speeds. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn v1_1( + params: FluxProPlusTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1.1", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/redux/mod.rs new file mode 100644 index 0000000000..730c2a69ed --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1/redux/mod.rs @@ -0,0 +1,648 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX 1.1 Redux [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn redux(params: FluxProRedux) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1.1/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/mod.rs new file mode 100644 index 0000000000..4c3d970532 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/mod.rs @@ -0,0 +1,665 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX1.1 [pro], next generation text-to-image model, with 10x accelerated speeds. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn v1_1_ultra( + params: FluxProUltraTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1.1-ultra", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/redux/mod.rs new file mode 100644 index 0000000000..cd99f59b4b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra/redux/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX 1.1 Ultra Redux [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn redux( + params: FluxProUltraTextToImageInputRedux, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1.1-ultra/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra_finetuned/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra_finetuned/mod.rs new file mode 100644 index 0000000000..9ec5ee4c0b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro/v1_1_ultra_finetuned/mod.rs @@ -0,0 +1,650 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlFinetunedInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProCannyControlInput { + /// The control image URL to generate the Canny edge map from. + /// "https://fal.media/files/kangaroo/eNSkRdVFzNvDkrrMjxFA3.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A pink owl." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlFinetunedInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProDepthControlInput { + /// The control image URL to generate the depth map from. + /// "https://fal.media/files/penguin/vt-SeIOweN7_oYBsvGO6t.png" + pub control_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A blackhole in space." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProFillInput { + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProOutpaintInput { + /// Pixels to expand at the bottom + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_bottom: Option, + /// Pixels to expand on the left + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_left: Option, + /// Pixels to expand on the right + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_right: Option, + /// Pixels to expand at the top + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_top: Option, + /// The image URL to expand using outpainting + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProPlusTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProRedux { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageFinetunedInput { + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProTextToImageInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageFinetunedInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// References your specific model + pub finetune_id: String, + /// Controls finetune influence. + /// Increase this value if your target concept isn't showing up strongly enough. + /// The optimal setting depends on your finetune and prompt + pub finetune_strength: f64, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInput { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxProUltraTextToImageInputRedux { + /// The aspect ratio of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The strength of the image prompt, between 0 and 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_strength: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generate less processed, more natural-looking images. + #[serde(skip_serializing_if = "Option::is_none")] + pub raw: Option, + /// The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_tolerance: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AspectRatioProperty { + #[default] + #[serde(rename = "21:9")] + Property_21_9, + #[serde(rename = "16:9")] + Property_16_9, + #[serde(rename = "4:3")] + Property_4_3, + #[serde(rename = "3:2")] + Property_3_2, + #[serde(rename = "1:1")] + Property_1_1, + #[serde(rename = "2:3")] + Property_2_3, + #[serde(rename = "3:4")] + Property_3_4, + #[serde(rename = "9:16")] + Property_9_16, + #[serde(rename = "9:21")] + Property_9_21, + String(String), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX1.1 [pro] ultra +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +/// +/// FLUX1.1 [pro], next generation text-to-image model, with 10x accelerated speeds. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn v1_1_ultra_finetuned( + params: FluxProUltraTextToImageFinetunedInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro/v1.1-ultra-finetuned", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro_trainer/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro_trainer/mod.rs new file mode 100644 index 0000000000..111033bf89 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pro_trainer/mod.rs @@ -0,0 +1,85 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxFinetuneInput { + /// Enables/disables automatic image captioning + #[serde(skip_serializing_if = "Option::is_none")] + pub captioning: Option, + /// URL to the training data + pub data_url: String, + /// Descriptive note to identify your fine-tune since names are UUIDs. Will be displayed in finetune_details. + /// "test-1" + pub finetune_comment: String, + /// Choose between 'full' for a full finetuning + post hoc extraction of the trained weights into a LoRA or 'lora' for a raw LoRA training + /// "full" + /// "lora" + #[serde(skip_serializing_if = "Option::is_none")] + pub finetune_type: Option, + /// Defines training duration + #[serde(skip_serializing_if = "Option::is_none")] + pub iterations: Option, + /// Learning rate for training. Lower values may be needed for certain scenarios. Default is 1e-5 for full and 1e-4 for LoRA. + #[serde(skip_serializing_if = "Option::is_none")] + pub learning_rate: Option, + /// Choose between 32 and 16. A lora_rank of 16 can increase training efficiency and decrease loading times. + /// 32 + /// 16 + #[serde(skip_serializing_if = "Option::is_none")] + pub lora_rank: Option, + /// Determines the finetuning approach based on your concept + /// "character" + /// "product" + /// "style" + /// "general" + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// The speed priority will improve training and inference speed + /// "quality" + /// "speed" + /// "high_res_only" + #[serde(skip_serializing_if = "Option::is_none")] + pub priority: Option, + /// Unique word/phrase that will be used in the captions, to reference the newly introduced concepts + #[serde(skip_serializing_if = "Option::is_none")] + pub trigger_word: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FluxFinetuneOutput { + /// References your specific model + pub finetune_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Train Flux LoRAs For Pro Models +/// +/// Category: training +/// Machine Type: H100 +/// +/// +/// FLUX.1 Finetune [pro] API, next generation text-to-image model. +/// +/// All usages of this model must comply with [FLUX.1 PRO Terms of Service](https://blackforestlabs.ai/terms-of-service/). +pub fn flux_pro_trainer( + params: FluxFinetuneInput, +) -> FalRequest { + FalRequest::new("fal-ai/flux-pro-trainer", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pulid/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pulid/mod.rs new file mode 100644 index 0000000000..4edb656e63 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_pulid/mod.rs @@ -0,0 +1,136 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxPulidInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The weight of the ID loss. + #[serde(skip_serializing_if = "Option::is_none")] + pub id_weight: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The maximum sequence length for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_sequence_length: Option, + /// The prompt to generate an image from. + /// "bad quality, worst quality, text, signature, watermark, extra limbs" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a woman holding sign with glowing green text 'PuLID for FLUX'" + pub prompt: String, + /// URL of image to use for inpainting. + /// "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png" + pub reference_image_url: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The number of steps to start the CFG from. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_step: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The weight of the CFG loss. + #[serde(skip_serializing_if = "Option::is_none")] + pub true_cfg: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// PuLID Flux +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn flux_pulid(params: FluxPulidInput) -> FalRequest { + FalRequest::new("fal-ai/flux-pulid", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_subject/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_subject/mod.rs new file mode 100644 index 0000000000..c1093fbb92 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/flux_subject/mod.rs @@ -0,0 +1,126 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FluxSubjectInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image of the subject + /// "https://storage.googleapis.com/falserverless/model_tests/ominicontrol/ominishirt.jpg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "On the beach, a lady sits under a beach umbrella with 'Omini' written on it. She's wearing this shirt and has a big smile on her face, with her surfboard hehind her. The sun is setting in the background. The sky is a beautiful shade of orange and purple." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// FLUX.1 Subject +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn flux_subject(params: FluxSubjectInput) -> FalRequest { + FalRequest::new("fal-ai/flux-subject", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/image_prompt/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/image_prompt/mod.rs new file mode 100644 index 0000000000..9df0a7b05f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/image_prompt/mod.rs @@ -0,0 +1,481 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusImagePromptInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + pub image_prompt_1: ImagePrompt, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "pikachu" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_image_url: Option, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusInpaintInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// If set to true, the initial preprocessing will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_disable_initial_latent: Option, + /// Version of Fooocus inpaint model + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_engine: Option, + /// Positive value will make white area in the mask larger, negative value will + /// make white area smaller. (default is 0, always process before any mask + /// invert) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_erode_or_dilate: Option, + /// The image to use as a reference for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub inpaint_image_url: String, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The area to inpaint. Value 0 is same as "Only Masked" in A1111. Value 1 is + /// same as "Whole Image" in A1111. Only used in inpaint, not used in outpaint. + /// (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_respective_field: Option, + /// Same as the denoising strength in A1111 inpaint. Only used in inpaint, not + /// used in outpaint. (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_strength: Option, + /// If set to true, the mask will be inverted. + #[serde(skip_serializing_if = "Option::is_none")] + pub invert_mask: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// If set to true, the advanced inpaint options ('inpaint_disable_initial_latent', + /// 'inpaint_engine', 'inpaint_strength', 'inpaint_respective_field', + /// 'inpaint_erode_or_dilate') will be overridden. + /// Otherwise, the default values will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub override_inpaint_options: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a cat on a bench, realistic, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusLegacyInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The stop at value of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_stop_at: Option, + /// The image to use as a reference for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_url: Option, + /// The strength of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_weight: Option, + /// The type of image control + /// "ImagePrompt" + /// "PyraCanny" + /// "CPDS" + /// "FaceSwap" + #[serde(skip_serializing_if = "Option::is_none")] + pub control_type: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an astronaut in the jungle, cold color palette with butterflies in the background, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FooocusOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image file info. + pub images: Vec, + /// The time taken for the generation process. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusUpscaleOrVaryInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a basket of various fruits, bokeh, realistic, masterpiece" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + /// "https://storage.googleapis.com/falserverless/model_tests/fooocus/fruit_basket.jpeg" + pub uov_image_url: String, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImagePrompt { + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stop_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + /// "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_prompt( + params: FooocusImagePromptInput, +) -> FalRequest { + FalRequest::new("fal-ai/fooocus/image-prompt", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/inpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/inpaint/mod.rs new file mode 100644 index 0000000000..ff1c29d466 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/inpaint/mod.rs @@ -0,0 +1,479 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusImagePromptInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + pub image_prompt_1: ImagePrompt, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "pikachu" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_image_url: Option, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusInpaintInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// If set to true, the initial preprocessing will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_disable_initial_latent: Option, + /// Version of Fooocus inpaint model + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_engine: Option, + /// Positive value will make white area in the mask larger, negative value will + /// make white area smaller. (default is 0, always process before any mask + /// invert) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_erode_or_dilate: Option, + /// The image to use as a reference for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub inpaint_image_url: String, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The area to inpaint. Value 0 is same as "Only Masked" in A1111. Value 1 is + /// same as "Whole Image" in A1111. Only used in inpaint, not used in outpaint. + /// (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_respective_field: Option, + /// Same as the denoising strength in A1111 inpaint. Only used in inpaint, not + /// used in outpaint. (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_strength: Option, + /// If set to true, the mask will be inverted. + #[serde(skip_serializing_if = "Option::is_none")] + pub invert_mask: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// If set to true, the advanced inpaint options ('inpaint_disable_initial_latent', + /// 'inpaint_engine', 'inpaint_strength', 'inpaint_respective_field', + /// 'inpaint_erode_or_dilate') will be overridden. + /// Otherwise, the default values will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub override_inpaint_options: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a cat on a bench, realistic, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusLegacyInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The stop at value of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_stop_at: Option, + /// The image to use as a reference for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_url: Option, + /// The strength of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_weight: Option, + /// The type of image control + /// "ImagePrompt" + /// "PyraCanny" + /// "CPDS" + /// "FaceSwap" + #[serde(skip_serializing_if = "Option::is_none")] + pub control_type: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an astronaut in the jungle, cold color palette with butterflies in the background, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FooocusOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image file info. + pub images: Vec, + /// The time taken for the generation process. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusUpscaleOrVaryInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a basket of various fruits, bokeh, realistic, masterpiece" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + /// "https://storage.googleapis.com/falserverless/model_tests/fooocus/fruit_basket.jpeg" + pub uov_image_url: String, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImagePrompt { + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stop_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + /// "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpaint(params: FooocusInpaintInput) -> FalRequest { + FalRequest::new("fal-ai/fooocus/inpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/mod.rs new file mode 100644 index 0000000000..f9524feccd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/mod.rs @@ -0,0 +1,522 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" + ))) +)] +pub mod image_prompt; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" + ))) +)] +pub mod inpaint; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" + ))) +)] +pub mod upscale_or_vary; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusImagePromptInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + pub image_prompt_1: ImagePrompt, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "pikachu" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_image_url: Option, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusInpaintInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// If set to true, the initial preprocessing will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_disable_initial_latent: Option, + /// Version of Fooocus inpaint model + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_engine: Option, + /// Positive value will make white area in the mask larger, negative value will + /// make white area smaller. (default is 0, always process before any mask + /// invert) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_erode_or_dilate: Option, + /// The image to use as a reference for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub inpaint_image_url: String, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The area to inpaint. Value 0 is same as "Only Masked" in A1111. Value 1 is + /// same as "Whole Image" in A1111. Only used in inpaint, not used in outpaint. + /// (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_respective_field: Option, + /// Same as the denoising strength in A1111 inpaint. Only used in inpaint, not + /// used in outpaint. (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_strength: Option, + /// If set to true, the mask will be inverted. + #[serde(skip_serializing_if = "Option::is_none")] + pub invert_mask: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// If set to true, the advanced inpaint options ('inpaint_disable_initial_latent', + /// 'inpaint_engine', 'inpaint_strength', 'inpaint_respective_field', + /// 'inpaint_erode_or_dilate') will be overridden. + /// Otherwise, the default values will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub override_inpaint_options: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a cat on a bench, realistic, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusLegacyInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The stop at value of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_stop_at: Option, + /// The image to use as a reference for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_url: Option, + /// The strength of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_weight: Option, + /// The type of image control + /// "ImagePrompt" + /// "PyraCanny" + /// "CPDS" + /// "FaceSwap" + #[serde(skip_serializing_if = "Option::is_none")] + pub control_type: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an astronaut in the jungle, cold color palette with butterflies in the background, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FooocusOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image file info. + pub images: Vec, + /// The time taken for the generation process. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusUpscaleOrVaryInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a basket of various fruits, bokeh, realistic, masterpiece" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + /// "https://storage.googleapis.com/falserverless/model_tests/fooocus/fruit_basket.jpeg" + pub uov_image_url: String, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImagePrompt { + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stop_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + /// "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn fooocus(params: FooocusLegacyInput) -> FalRequest { + FalRequest::new("fal-ai/fooocus", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/upscale_or_vary/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/upscale_or_vary/mod.rs new file mode 100644 index 0000000000..1bc604eab6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/fooocus/upscale_or_vary/mod.rs @@ -0,0 +1,481 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusImagePromptInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + pub image_prompt_1: ImagePrompt, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "pikachu" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_image_url: Option, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusInpaintInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// Describe what you want to inpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_additional_prompt: Option, + /// If set to true, the initial preprocessing will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_disable_initial_latent: Option, + /// Version of Fooocus inpaint model + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_engine: Option, + /// Positive value will make white area in the mask larger, negative value will + /// make white area smaller. (default is 0, always process before any mask + /// invert) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_erode_or_dilate: Option, + /// The image to use as a reference for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub inpaint_image_url: String, + /// The mode to use for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mode: Option, + /// The area to inpaint. Value 0 is same as "Only Masked" in A1111. Value 1 is + /// same as "Whole Image" in A1111. Only used in inpaint, not used in outpaint. + /// (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_respective_field: Option, + /// Same as the denoising strength in A1111 inpaint. Only used in inpaint, not + /// used in outpaint. (Outpaint always use 1.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_strength: Option, + /// If set to true, the mask will be inverted. + #[serde(skip_serializing_if = "Option::is_none")] + pub invert_mask: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Mixing Image Prompt and Inpaint + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The directions to outpaint. + #[serde(skip_serializing_if = "Option::is_none")] + pub outpaint_selections: Option>>, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// If set to true, the advanced inpaint options ('inpaint_disable_initial_latent', + /// 'inpaint_engine', 'inpaint_strength', 'inpaint_respective_field', + /// 'inpaint_erode_or_dilate') will be overridden. + /// Otherwise, the default values will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub override_inpaint_options: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a cat on a bench, realistic, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusLegacyInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The stop at value of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_stop_at: Option, + /// The image to use as a reference for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_url: Option, + /// The strength of the control image. Use it to control how much the generated image + /// should look like the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub control_image_weight: Option, + /// The type of image control + /// "ImagePrompt" + /// "PyraCanny" + /// "CPDS" + /// "FaceSwap" + #[serde(skip_serializing_if = "Option::is_none")] + pub control_type: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to use as a reference for inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_image_url: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The image to use as a mask for the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_inpaint: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an astronaut in the jungle, cold color palette with butterflies in the background, highly detailed, 8k" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FooocusOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image file info. + pub images: Vec, + /// The time taken for the generation process. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FooocusUpscaleOrVaryInput { + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_3: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_prompt_4: Option, + /// The LoRAs to use for the image generation. You can use up to 5 LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Mixing Image Prompt and Vary/Upscale + #[serde(skip_serializing_if = "Option::is_none")] + pub mixing_image_prompt_and_vary_upscale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// You can choose Speed or Quality + #[serde(skip_serializing_if = "Option::is_none")] + pub performance: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a basket of various fruits, bokeh, realistic, masterpiece" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Refiner (SDXL or SD 1.5) + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_model: Option, + /// Use 0.4 for SD1.5 realistic models; 0.667 for SD1.5 anime models + /// 0.8 for XL-refiners; or any value for switching two SDXL models. + #[serde(skip_serializing_if = "Option::is_none")] + pub refiner_switch: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 176400 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The sharpness of the generated image. Use it to control how sharp the generated + /// image should be. Higher value means image and texture are sharper. + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpness: Option, + /// The style to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub styles: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The image to upscale or vary. + /// "https://storage.googleapis.com/falserverless/model_tests/fooocus/fruit_basket.jpeg" + pub uov_image_url: String, + /// The method to use for upscaling or varying. + #[serde(skip_serializing_if = "Option::is_none")] + pub uov_method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImagePrompt { + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stop_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + /// "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Fooocus +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn upscale_or_vary( + params: FooocusUpscaleOrVaryInput, +) -> FalRequest { + FalRequest::new("fal-ai/fooocus/upscale-or-vary", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/mod.rs new file mode 100644 index 0000000000..4d9e8beaad --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/mod.rs @@ -0,0 +1,142 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_gemini-flash-edit" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_gemini-flash-edit" + ))) +)] +pub mod multi; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GeminiImageOutput { + /// Text description or response from Gemini + pub description: String, + /// The generated or edited image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GeminiImageRequest { + /// Optional URL of an input image for editing. If not provided, generates a new image. + /// "https://storage.googleapis.com/falserverless/web-examples/gemini-edit/input.png" + pub image_url: String, + /// The prompt for image generation or editing + /// "Make the car black" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GeminiMultiImageRequest { + /// List of URLs of input images for editing + /// ["https://storage.googleapis.com/falserverless/web-examples/gemini-edit/input.png"] + pub input_image_urls: Vec, + /// The prompt for image generation or editing + /// "Make the car black" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Gemini Flash Edit +/// +/// Category: image-to-image +/// +/// +/// +/// Generate or edit an image using Gemini +pub fn gemini_flash_edit( + params: GeminiImageRequest, +) -> FalRequest { + FalRequest::new("fal-ai/gemini-flash-edit", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/multi/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/multi/mod.rs new file mode 100644 index 0000000000..fa7f3de66e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/gemini_flash_edit/multi/mod.rs @@ -0,0 +1,127 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize)] +pub struct GeminiImageOutput { + /// Text description or response from Gemini + pub description: String, + /// The generated or edited image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GeminiImageRequest { + /// Optional URL of an input image for editing. If not provided, generates a new image. + /// "https://storage.googleapis.com/falserverless/web-examples/gemini-edit/input.png" + pub image_url: String, + /// The prompt for image generation or editing + /// "Make the car black" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GeminiMultiImageRequest { + /// List of URLs of input images for editing + /// ["https://storage.googleapis.com/falserverless/web-examples/gemini-edit/input.png"] + pub input_image_urls: Vec, + /// The prompt for image generation or editing + /// "Make the car black" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Gemini Flash Edit +/// +/// Category: image-to-image +/// +/// +/// +/// Generate or edit images using Gemini with multiple input images +pub fn multi( + params: GeminiMultiImageRequest, +) -> FalRequest { + FalRequest::new("fal-ai/gemini-flash-edit/multi", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/mod.rs new file mode 100644 index 0000000000..e6a82b16f3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_got-ocr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_got-ocr" + ))) +)] +pub mod v2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/v2/mod.rs new file mode 100644 index 0000000000..1acc3d183f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/got_ocr/v2/mod.rs @@ -0,0 +1,48 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageChatOutput { + /// Generated output + pub outputs: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Generate the output in formatted mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub do_format: Option, + /// URL of images. + + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, + /// Use provided images to generate a single output. + #[serde(skip_serializing_if = "Option::is_none")] + pub multi_page: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// GOT OCR 2.0 +/// +/// Category: vision +/// Machine Type: A100 +pub fn v2(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/got-ocr/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/mod.rs new file mode 100644 index 0000000000..8eadf1faa1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod v2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/mod.rs new file mode 100644 index 0000000000..38a72e7fcb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/mod.rs @@ -0,0 +1,135 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn mini(params: Hunyuan3DInput) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2/mini", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/turbo/mod.rs new file mode 100644 index 0000000000..57a5c18cdb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mini/turbo/mod.rs @@ -0,0 +1,120 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn turbo(params: Hunyuan3DInput) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2/mini/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mod.rs new file mode 100644 index 0000000000..6e509a6d63 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/mod.rs @@ -0,0 +1,163 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod mini; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod multi_view; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn v2(params: Hunyuan3DInput) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/mod.rs new file mode 100644 index 0000000000..d44b1f6211 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/mod.rs @@ -0,0 +1,137 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn multi_view( + params: Hunyuan3DInputMultiView, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2/multi-view", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/turbo/mod.rs new file mode 100644 index 0000000000..d7ee47ff4f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/multi_view/turbo/mod.rs @@ -0,0 +1,122 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn turbo( + params: Hunyuan3DInputMultiView, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2/multi-view/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/turbo/mod.rs new file mode 100644 index 0000000000..0d82a754f1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan3d/v2/turbo/mod.rs @@ -0,0 +1,120 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInput { + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + pub input_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Hunyuan3DInputMultiView { + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/back.png" + pub back_image_url: String, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/front.png" + pub front_image_url: String, + /// Guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of image to use while generating the 3D model. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/left.png" + pub left_image_url: String, + /// Number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Octree resolution for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub octree_resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set true, textured mesh will be generated and the price charged would be 3 times that of white mesh. + #[serde(skip_serializing_if = "Option::is_none")] + pub textured_mesh: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiViewObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"white_mesh.glb","file_size":720696,"url":"https://v3.fal.media/files/lion/WqIhtKPaSoeBtC30qzIGG_white_mesh.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan3D +/// +/// Category: image-to-3d +/// Machine Type: H100 +/// License Type: commercial +pub fn turbo(params: Hunyuan3DInput) -> FalRequest { + FalRequest::new("fal-ai/hunyuan3d/v2/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/mod.rs new file mode 100644 index 0000000000..752c2077c2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/mod.rs @@ -0,0 +1,147 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video" + ))) +)] +pub mod video_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HunyuanT2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanV2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to run. Lower gets faster results, higher gets better results. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a dark blue leather jacket, a long pink dress, and bright yellow boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Video-to-Video + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video input. + /// "https://storage.googleapis.com/falserverless/hunyuan_video/hunyuan_v2v_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanVideoRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to run. Lower gets faster results, higher gets better results. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video +/// +/// Category: text-to-video +/// Machine Type: H100 +pub fn hunyuan_video( + params: HunyuanVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/video_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/video_to_video/mod.rs new file mode 100644 index 0000000000..b5c9177178 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video/video_to_video/mod.rs @@ -0,0 +1,135 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HunyuanT2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanV2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to run. Lower gets faster results, higher gets better results. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a dark blue leather jacket, a long pink dress, and bright yellow boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Video-to-Video + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video input. + /// "https://storage.googleapis.com/falserverless/hunyuan_video/hunyuan_v2v_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanVideoRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of inference steps to run. Lower gets faster results, higher gets better results. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Hunyuan Video API for fast video generation. Text-to-video and video-to-video modes are supported. +pub fn video_to_video( + params: HunyuanV2VRequest, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video/video-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_image_to_video/mod.rs new file mode 100644 index 0000000000..2940873c19 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_image_to_video/mod.rs @@ -0,0 +1,83 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HunyuanI2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanVideoRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Turning on I2V Stability reduces hallucination but also reduces motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub i2v_stability: Option, + /// URL of the image input. + /// "https://storage.googleapis.com/falserverless/example_inputs/hunyuan_i2v.jpg" + pub image_url: String, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The prompt to generate the video from. + /// "Two muscular cats boxing in a boxing ring." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video Image-to-Video Inference +/// +/// Category: image-to-video +/// Machine Type: H100 +pub fn hunyuan_video_image_to_video( + params: HunyuanVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video-image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_img2vid_lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_img2vid_lora/mod.rs new file mode 100644 index 0000000000..ecf45b93ec --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_img2vid_lora/mod.rs @@ -0,0 +1,77 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The URL to the image to generate the video from. The image must be 960x544 or it will get cropped and resized to that size. + /// "https://d3phaj0sisr2ct.cloudfront.net/research/eugene.jpg" + pub image_url: String, + /// The prompt to generate the video from. + /// "A low angle shot of a man walking down a street, illuminated by the neon signs of the bars around him" + pub prompt: String, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The seed used for generating the video. + pub seed: i64, + /// The generated video + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/gallery/man-smiles.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video Image-to-Video LoRA Inference +/// +/// Category: image-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video based on a prompt and an image URL. +/// This implementation downloads the image from the URL, replicates it to form a video, +/// encodes the prompt, uses video2video conditioning and sampling to produce new video latents, +/// decodes the latents to video frames, and saves the video to a temporary file. +pub fn hunyuan_video_img2vid_lora(params: Input) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video-img2vid-lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/mod.rs new file mode 100644 index 0000000000..6ceba359d0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/mod.rs @@ -0,0 +1,151 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora" + ))) +)] +pub mod video_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanT2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HunyuanT2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanV2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a dark blue leather jacket, a long pink dress, and bright yellow boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Video-to-Video + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video input. + /// "https://storage.googleapis.com/falserverless/hunyuan_video/hunyuan_v2v_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video LoRA Inference +/// +/// Category: text-to-video +/// Machine Type: H100 +pub fn hunyuan_video_lora( + params: HunyuanT2VRequest, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video-lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/video_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/video_to_video/mod.rs new file mode 100644 index 0000000000..f1a96a3125 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora/video_to_video/mod.rs @@ -0,0 +1,139 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanT2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HunyuanT2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HunyuanV2VRequest { + /// The aspect ratio of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub pro_mode: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a dark blue leather jacket, a long pink dress, and bright yellow boots, and carries a black purse." + pub prompt: String, + /// The resolution of the video to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Video-to-Video + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// URL of the video input. + /// "https://storage.googleapis.com/falserverless/hunyuan_video/hunyuan_v2v_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Hunyuan Video LoRA Inference +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Hunyuan Video API for fast video generation. Text-to-video and video-to-video modes are supported. +pub fn video_to_video( + params: HunyuanV2VRequest, +) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video-lora/video-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora_training/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora_training/mod.rs new file mode 100644 index 0000000000..8f8434d6a0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hunyuan_video_lora_training/mod.rs @@ -0,0 +1,118 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URL to the lora configuration file. + pub config_file: File, + /// URL to the trained diffusers lora weights. + pub diffusers_lora_file: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PublicInput { + /// The format of the archive. If not specified, the format will be inferred from the URL. + #[serde(skip_serializing_if = "Option::is_none")] + pub data_archive_format: Option, + /// Whether to generate captions for the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub do_caption: Option, + /// URL to zip archive with images. Try to use at least 4 images in general the more the better. + /// + /// In addition to images the archive can contain text files with captions. Each text file should have the same name as the image file it corresponds to. + pub images_data_url: String, + /// Learning rate to use for training. + #[serde(skip_serializing_if = "Option::is_none")] + pub learning_rate: Option, + /// Number of steps to train the LoRA on. + /// 1000 + pub steps: i64, + /// The trigger word to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub trigger_word: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum DataArchiveFormatProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Train Hunyuan LoRA +/// +/// Category: training +/// Machine Type: A100 +/// +/// +/// Hunyuan Video LoRA fine-tuning endpoint. +/// +/// This endpoint fine-tunes a LoRA model on a dataset of images. +/// +/// To provide your own captions, you can include a text file with the same name as +/// the image file. For example, if you have an image `photo.jpg`, you can include a +/// text file `photo.txt` with the caption. +pub fn hunyuan_video_lora_training(params: PublicInput) -> FalRequest { + FalRequest::new("fal-ai/hunyuan-video-lora-training", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/mod.rs new file mode 100644 index 0000000000..614cfd918f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper3d" + ))) +)] +pub mod rodin; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/rodin/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/rodin/mod.rs new file mode 100644 index 0000000000..80f422fb9a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper3d/rodin/mod.rs @@ -0,0 +1,190 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + /// {"content_type":"application/octet-stream","file_name":"base_basic_pbr.glb","file_size":2230472,"url":"https://v3.fal.media/files/koala/VlX4JqNI8F9HO2ETp_B7t_base_basic_pbr.glb"} + pub model_mesh: File, + /// Seed value used for generation. + pub seed: i64, + /// Generated textures for the 3D object. + pub textures: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Rodin3DInput { + /// When generating the human-like model, this parameter control the generation result to T/A Pose. + #[serde(skip_serializing_if = "Option::is_none")] + pub tapose: Option, + /// Generation add-on features. Default is []. Possible values are HighPack. The HighPack option will provide 4K resolution textures instead of the default 1K, as well as models with high-poly. It will cost triple the billable units. + #[serde(skip_serializing_if = "Option::is_none")] + pub addons: Option, + /// An array that specifies the dimensions and scaling factor of the bounding box. Typically, this array contains 3 elements, Length(X-axis), Width(Y-axis) and Height(Z-axis). + #[serde(skip_serializing_if = "Option::is_none")] + pub bbox_condition: Option, + /// For fuse mode, One or more images are required.It will generate a model by extracting and fusing features of objects from multiple images.For concat mode, need to upload multiple multi-view images of the same object and generate the model.(You can upload multi-view images in any order, regardless of the order of view.) + #[serde(skip_serializing_if = "Option::is_none")] + pub condition_mode: Option, + /// Format of the geometry file. Possible values: glb, usdz, fbx, obj, stl. Default is glb. + #[serde(skip_serializing_if = "Option::is_none")] + pub geometry_file_format: Option, + /// URL of images to use while generating the 3D model. Required for Image-to-3D mode. Optional for Text-to-3D mode. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/robot.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, + /// Material type. Possible values: PBR, Shaded. Default is PBR. + /// "Shaded" + #[serde(skip_serializing_if = "Option::is_none")] + pub material: Option, + /// A textual prompt to guide model generation. Required for Text-to-3D mode. Optional for Image-to-3D mode. + /// "A futuristic robot with sleek metallic design." + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Generation quality. Possible values: high, medium, low, extra-low. Default is medium. + #[serde(skip_serializing_if = "Option::is_none")] + pub quality: Option, + /// Seed value for randomization, ranging from 0 to 65535. Optional. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Tier of generation. For Rodin Sketch, set to Sketch. For Rodin Regular, set to Regular. + #[serde(skip_serializing_if = "Option::is_none")] + pub tier: Option, + /// Whether to export the model using hyper mode. Default is false. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_hyper: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum AddonsProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum BboxConditionProperty { + #[default] + Array(Vec), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Hyper3D Rodin +/// +/// Category: image-to-3d +/// Machine Type: A100 +pub fn rodin(params: Rodin3DInput) -> FalRequest { + FalRequest::new("fal-ai/hyper3d/rodin", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/image_to_image/mod.rs new file mode 100644 index 0000000000..b798f6a183 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/image_to_image/mod.rs @@ -0,0 +1,236 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Hyper SDXL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: ImageToImageHyperInput, +) -> FalRequest { + FalRequest::new("fal-ai/hyper-sdxl/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/inpainting/mod.rs new file mode 100644 index 0000000000..b69924f96c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/inpainting/mod.rs @@ -0,0 +1,234 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Hyper SDXL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting(params: InpaintingHyperInput) -> FalRequest { + FalRequest::new("fal-ai/hyper-sdxl/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/mod.rs new file mode 100644 index 0000000000..0b81d08638 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/hyper_sdxl/mod.rs @@ -0,0 +1,263 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageHyperInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Hyper SDXL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn hyper_sdxl(params: TextToImageHyperInput) -> FalRequest { + FalRequest::new("fal-ai/hyper-sdxl", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/iclight_v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/iclight_v2/mod.rs new file mode 100644 index 0000000000..cc307e39e6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/iclight_v2/mod.rs @@ -0,0 +1,152 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// Threshold for the background removal algorithm. A high threshold will produce sharper masks. Note: This parameter is currently deprecated and has no effect on the output. + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// The real classifier-free-guidance scale for the generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg: Option, + /// Use HR fix + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_hr_fix: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Strength for high-resolution pass. Only used if enable_hr_fix is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub highres_denoise: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hr_downscale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/iclight-v2/bottle.png" + pub image_url: String, + /// Provide lighting conditions for the model + #[serde(skip_serializing_if = "Option::is_none")] + pub initial_latent: Option, + /// Strength for low-resolution pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub lowres_denoise: Option, + /// URL of mask to be used for ic-light conditioning image + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Negative Prompt for the image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "perfume bottle in a volcano surrounded by lava." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// IC-Light-v2 for Image Relighting +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn iclight_v2(params: BaseInput) -> FalRequest { + FalRequest::new("fal-ai/iclight-v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/mod.rs new file mode 100644 index 0000000000..272c813117 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod upscale; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod v2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod v2a; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/upscale/mod.rs new file mode 100644 index 0000000000..76d0a46b76 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/upscale/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram's state-of-the-art image upscaling model. Can be used as an API directly from fal. +pub fn upscale(params: UpscaleImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/upscale", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/edit/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/edit/mod.rs new file mode 100644 index 0000000000..eb87efd591 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/edit/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram's state-of-the-art image editing model. Can be used as an API directly from fal. +pub fn edit(params: EditImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2/edit", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/mod.rs new file mode 100644 index 0000000000..dda943cd8e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/mod.rs @@ -0,0 +1,200 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod edit; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod remix; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram's state-of-the-art image generation model. Can be used as an API directly from fal. +pub fn v2(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/remix/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/remix/mod.rs new file mode 100644 index 0000000000..e1a5c88c7b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/remix/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram's state-of-the-art image remixing model. Can be used as an API directly from fal. +pub fn remix(params: RemixImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2/remix", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/edit/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/edit/mod.rs new file mode 100644 index 0000000000..69142f49aa --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/edit/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Faster version of Ideogram 2.0 Edit. Can be used as an API directly from fal. +pub fn edit(params: EditImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2/turbo/edit", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/mod.rs new file mode 100644 index 0000000000..27da7539c1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod edit; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod remix; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Faster version of Ideogram 2.0. Can be used as an API directly from fal. +pub fn turbo(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/remix/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/remix/mod.rs new file mode 100644 index 0000000000..82d3e5f49a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2/turbo/remix/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Faster version of Ideogram 2.0 Remix. Can be used as an API directly from fal. +pub fn remix(params: RemixImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2/turbo/remix", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/mod.rs new file mode 100644 index 0000000000..5136122045 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod remix; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram 2a - faster, more affordable model with better text accuracy. Can be used as an API directly from fal. +pub fn v2a(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2a", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/remix/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/remix/mod.rs new file mode 100644 index 0000000000..9c550baa4c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/remix/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Ideogram 2a's image remixing model. Can be used as an API directly from fal. +pub fn remix(params: RemixImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2a/remix", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/mod.rs new file mode 100644 index 0000000000..372a5a2c44 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/mod.rs @@ -0,0 +1,172 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod remix; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Faster version of Ideogram 2a. Can be used as an API directly from fal. +pub fn turbo(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2a/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/remix/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/remix/mod.rs new file mode 100644 index 0000000000..51e7ccad78 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ideogram/v2a/turbo/remix/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct EditImageInput { + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to generate an image from. Needs to match the dimensions of the mask. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/knight.jpeg" + pub image_url: String, + /// The mask URL to inpaint the image. Needs to match the dimensions of the input image. + /// "https://storage.googleapis.com/falserverless/flux-lora/example-images/mask_knight.jpeg" + pub mask_url: String, + /// The prompt to fill the masked part of the image. + /// "A knight in shining armour holding a greatshield with \"FAL\" on it" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemixImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to remix + /// "https://fal.media/files/lion/FHOx4y4a0ef7Sgmo-sOUR_image.png" + pub image_url: String, + /// The prompt to remix the image with + /// "An ice field in north atlantic" + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength of the input image in the remix + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// A negative prompt to avoid in the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleImageInput { + /// The detail of the upscaled image + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option, + /// Whether to expand the prompt with MagicPrompt functionality. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The image URL to upscale + /// "https://fal.media/files/monkey/e6RtJf_ue0vyWzeiEmTby.png" + pub image_url: String, + /// The prompt to upscale the image with + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The resemblance of the upscaled image to the original image + #[serde(skip_serializing_if = "Option::is_none")] + pub resemblance: Option, + /// Seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + pub images: Vec, + /// Seed used for the random number generator + /// 123456 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Ideogram V2 +/// +/// Category: text-to-image +/// +/// License Type: commercial +/// +/// Faster version of Ideogram 2a Remix. Can be used as an API directly from fal. +pub fn remix(params: RemixImageInput) -> FalRequest { + FalRequest::new("fal-ai/ideogram/v2a/turbo/remix", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/illusion_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/illusion_diffusion/mod.rs new file mode 100644 index 0000000000..7b9a14937f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/illusion_diffusion/mod.rs @@ -0,0 +1,147 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IllusionDiffusionInput { + #[serde(skip_serializing_if = "Option::is_none")] + pub control_guidance_end: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub control_guidance_start: Option, + /// The scale of the ControlNet. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/illusion-examples/pattern.png" + /// "https://storage.googleapis.com/falserverless/illusion-examples/checkers.png" + /// "https://storage.googleapis.com/falserverless/illusion-examples/checkers_mid.jpg" + /// "https://storage.googleapis.com/falserverless/illusion-examples/ultra_checkers.png" + /// "https://storage.googleapis.com/falserverless/illusion-examples/funky.jpeg" + /// "https://storage.googleapis.com/falserverless/illusion-examples/cubes.jpeg" + /// "https://storage.googleapis.com/falserverless/illusion-examples/turkey-flag.png" + /// "https://storage.googleapis.com/falserverless/illusion-examples/india-flag.png" + /// "https://storage.googleapis.com/falserverless/illusion-examples/usa-flag.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "(worst quality, poor details:1.4), lowres, (artist name, signature, watermark:1.4), bad-artist-anime, bad_prompt_version2, bad-hands-5, ng_deepnegative_v1_75t" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "(masterpiece:1.4), (best quality), (detailed), Medieval village scene with busy streets and castle in the distance" + pub prompt: String, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct IllusionDiffusionOutput { + /// The generated image file info. + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Illusion Diffusion +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn illusion_diffusion( + params: IllusionDiffusionInput, +) -> FalRequest { + FalRequest::new("fal-ai/illusion-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/canny/mod.rs new file mode 100644 index 0000000000..c8be4edd26 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/canny/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn canny(params: CannyInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/mod.rs new file mode 100644 index 0000000000..f64a5cffc5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod v2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/v2/mod.rs new file mode 100644 index 0000000000..cdd2c8ad47 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/depth_anything/v2/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn v2(params: DepthAnythingV2Input) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/depth-anything/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/hed/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/hed/mod.rs new file mode 100644 index 0000000000..3c61e518e8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/hed/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn hed(params: HEDInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/hed", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/lineart/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/lineart/mod.rs new file mode 100644 index 0000000000..1e43c9a7cf --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/lineart/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn lineart(params: LineartInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/lineart", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/midas/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/midas/mod.rs new file mode 100644 index 0000000000..0dc5d25ae8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/midas/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn midas(params: MiDaSInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/midas", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mlsd/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mlsd/mod.rs new file mode 100644 index 0000000000..170359764e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mlsd/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn mlsd(params: MLSDInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/mlsd", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mod.rs new file mode 100644 index 0000000000..2dbee95358 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/mod.rs @@ -0,0 +1,154 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod depth_anything; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod hed; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod lineart; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod midas; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod mlsd; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod pidi; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod sam; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod scribble; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod teed; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod zoe; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/pidi/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/pidi/mod.rs new file mode 100644 index 0000000000..95fd91c82e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/pidi/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn pidi(params: PiDiInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/pidi", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/sam/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/sam/mod.rs new file mode 100644 index 0000000000..f346e7436d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/sam/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn sam(params: SamInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/sam", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/scribble/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/scribble/mod.rs new file mode 100644 index 0000000000..cd3b5dd59f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/scribble/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn scribble(params: ScribbleInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/scribble", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/teed/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/teed/mod.rs new file mode 100644 index 0000000000..1b085362ac --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/teed/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn teed(params: TeeDInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/teed", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/zoe/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/zoe/mod.rs new file mode 100644 index 0000000000..556e34ea67 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/image_preprocessors/zoe/mod.rs @@ -0,0 +1,281 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure. Edges with a strength higher than the high threshold will always appear as edges in the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure. Edges with a strength higher than the low threshold will appear in the output image, if there are strong edges nearby. + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Input { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthAnythingV2Output { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the HED detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HEDOutput { + /// Image with lines detected using the HED detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartInput { + /// Whether to use the coarse model + #[serde(skip_serializing_if = "Option::is_none")] + pub coarse: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LineartOutput { + /// Image with edges detected using the Canny algorithm + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDInput { + /// Distance threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub distance_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Score threshold for the MLSD detector + #[serde(skip_serializing_if = "Option::is_none")] + pub score_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MLSDOutput { + /// Image with lines detected using the MLSD detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSInput { + /// A parameter for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// Background threshold for the MiDaS detector + #[serde(skip_serializing_if = "Option::is_none")] + pub background_threshold: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiDaSOutput { + /// Image with MiDaS depth map + pub depth_map: Image, + /// Image with MiDaS normal map + pub normal_map: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiInput { + /// Whether to apply the filter to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_filter: Option, + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// Whether to use the safe version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, + /// Whether to use the scribble version of the Pidi detector + #[serde(skip_serializing_if = "Option::is_none")] + pub scribble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PiDiOutput { + /// Image with Pidi lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Image with SAM segmentation map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, + /// The model to use for the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Whether to use the safe version of the Scribble detector + #[serde(skip_serializing_if = "Option::is_none")] + pub safe: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ScribbleOutput { + /// Image with lines detected using the Scribble detector + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeeDOutput { + /// Image with TeeD lines detected + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZoeInput { + /// URL of the image to process + /// "https://storage.googleapis.com/falserverless/model_tests/image_preprocessors/cat.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ZoeOutput { + /// Image with depth map + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn zoe(params: ZoeInput) -> FalRequest { + FalRequest::new("fal-ai/image-preprocessors/zoe", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/fast/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/fast/mod.rs new file mode 100644 index 0000000000..f551452cb4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/fast/mod.rs @@ -0,0 +1,116 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for generation + /// 42 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceImage { + /// URL to the reference image file (PNG format recommended) + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectCustomizeInput { + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see, using [1] to reference the subject + /// "Image of [1] in sunglasses posing as an astronaut in the moon" + pub prompt: String, + /// 1-4 reference images of the subject to customize + /// [{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/01.jpg"},{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/02.jpg"}] + pub reference_images: Vec, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optional description of the subject in the reference images + #[serde(skip_serializing_if = "Option::is_none")] + pub subject_description: Option, + /// Type of subject in the reference images + /// "animal" + pub subject_type: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see + /// "A serene landscape with mountains reflected in a crystal clear lake at sunset" + pub prompt: String, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Imagen3 +/// +/// Category: text-to-image +/// +/// +/// +/// Generate images using Google's Imagen 3 Fast model for lower latency. +/// +/// A faster version of Imagen 3 that maintains high quality while providing: +/// - Quicker generation times +/// - Support for diverse art styles +/// - Good prompt understanding +/// - Reliable text rendering +pub fn fast(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/imagen3/fast", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/mod.rs new file mode 100644 index 0000000000..7af93dc246 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/mod.rs @@ -0,0 +1,146 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" + ))) +)] +pub mod fast; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" + ))) +)] +pub mod subject_reference; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for generation + /// 42 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceImage { + /// URL to the reference image file (PNG format recommended) + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectCustomizeInput { + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see, using [1] to reference the subject + /// "Image of [1] in sunglasses posing as an astronaut in the moon" + pub prompt: String, + /// 1-4 reference images of the subject to customize + /// [{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/01.jpg"},{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/02.jpg"}] + pub reference_images: Vec, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optional description of the subject in the reference images + #[serde(skip_serializing_if = "Option::is_none")] + pub subject_description: Option, + /// Type of subject in the reference images + /// "animal" + pub subject_type: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see + /// "A serene landscape with mountains reflected in a crystal clear lake at sunset" + pub prompt: String, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Imagen3 +/// +/// Category: text-to-image +/// +/// +/// +/// Generate images using Google's Imagen 3 model. +/// +/// Imagen 3 is designed to generate high-quality images with enhanced detail, richer lighting, +/// and fewer artifacts. The model excels at: +/// - Capturing fine details and textures +/// - Rendering diverse art styles from photorealism to animation +/// - Understanding natural language prompts +/// - Maintaining high visual quality and composition +pub fn imagen3(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/imagen3", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/subject_reference/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/subject_reference/mod.rs new file mode 100644 index 0000000000..b015ee0dce --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imagen3/subject_reference/mod.rs @@ -0,0 +1,120 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + pub images: Vec, + /// Seed used for generation + /// 42 + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceImage { + /// URL to the reference image file (PNG format recommended) + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectCustomizeInput { + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see, using [1] to reference the subject + /// "Image of [1] in sunglasses posing as an astronaut in the moon" + pub prompt: String, + /// 1-4 reference images of the subject to customize + /// [{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/01.jpg"},{"image_url":"https://raw.githubusercontent.com/google/dreambooth/refs/heads/main/dataset/dog/02.jpg"}] + pub reference_images: Vec, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optional description of the subject in the reference images + #[serde(skip_serializing_if = "Option::is_none")] + pub subject_description: Option, + /// Type of subject in the reference images + /// "animal" + pub subject_type: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// The aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// A description of what to discourage in the generated images + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate (1-4) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The text prompt describing what you want to see + /// "A serene landscape with mountains reflected in a crystal clear lake at sunset" + pub prompt: String, + /// Random seed for reproducible generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Imagen3 +/// +/// Category: text-to-image +/// +/// +/// +/// Generate customized images using reference images of a subject. +/// +/// Supports customization for: +/// - Products: Generate new images of products in different contexts +/// - People: Create variations of people in different poses and settings +/// - Animal companions: Generate new images of pets in different scenes +/// +/// The reference images guide the model to maintain key characteristics +/// of the subject while generating new images matching your prompt. +pub fn subject_reference( + params: SubjectCustomizeInput, +) -> FalRequest { + FalRequest::new("fal-ai/imagen3/subject-reference", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/depth/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/depth/mod.rs new file mode 100644 index 0000000000..69226dddba --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/depth/mod.rs @@ -0,0 +1,216 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn depth(params: DepthMapInput) -> FalRequest { + FalRequest::new("fal-ai/imageutils/depth", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/esrgan/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/esrgan/mod.rs new file mode 100644 index 0000000000..2f9dc80c85 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/esrgan/mod.rs @@ -0,0 +1,216 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn esrgan(params: UpscaleInput) -> FalRequest { + FalRequest::new("fal-ai/imageutils/esrgan", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/marigold_depth/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/marigold_depth/mod.rs new file mode 100644 index 0000000000..badec2d91d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/marigold_depth/mod.rs @@ -0,0 +1,218 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn marigold_depth( + params: MarigoldDepthMapInput, +) -> FalRequest { + FalRequest::new("fal-ai/imageutils/marigold-depth", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/mod.rs new file mode 100644 index 0000000000..6643141d80 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/mod.rs @@ -0,0 +1,84 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod depth; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod esrgan; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod marigold_depth; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod nsfw; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod rembg; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod sam; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/nsfw/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/nsfw/mod.rs new file mode 100644 index 0000000000..d4bcf8f0cd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/nsfw/mod.rs @@ -0,0 +1,218 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn nsfw( + params: NSFWImageDetectionInput, +) -> FalRequest { + FalRequest::new("fal-ai/imageutils/nsfw", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/rembg/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/rembg/mod.rs new file mode 100644 index 0000000000..55d1c03da2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/rembg/mod.rs @@ -0,0 +1,218 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn rembg( + params: RemoveBackgroundInput, +) -> FalRequest { + FalRequest::new("fal-ai/imageutils/rembg", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/sam/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/sam/mod.rs new file mode 100644 index 0000000000..5553112655 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/imageutils/sam/mod.rs @@ -0,0 +1,216 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapInput { + /// a + #[serde(skip_serializing_if = "Option::is_none")] + pub a: Option, + /// bg_th + #[serde(skip_serializing_if = "Option::is_none")] + pub bg_th: Option, + /// depth_and_normal + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_and_normal: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapInput { + /// Number of predictions to average over. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ensemble_size: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Number of denoising steps. Defaults to `10`. The higher the number, the more accurate the result, but the slower the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Maximum processing resolution. Defaults `0` which means it uses the size of the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub processing_res: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MarigoldDepthMapOutput { + /// The depth map. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NSFWImageDetectionOutput { + /// The probability of the image being NSFW. + pub nsfw_probability: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundInput { + /// If set to true, the resulting image be cropped to a bounding box around the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub crop_to_bbox: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemoveBackgroundOutput { + /// Background removed image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SamInput { + /// Attempt better quality output using morphologyEx + #[serde(skip_serializing_if = "Option::is_none")] + pub better_quality: Option, + /// Output black and white, multiple masks will be combined into one mask + #[serde(skip_serializing_if = "Option::is_none")] + pub black_white: Option, + /// Coordinates for multiple boxes, e.g. [[x,y,w,h],[x2,y2,w2,h2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompt: Option>>>>, + /// Object confidence threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub confidence: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + pub image_url: String, + /// Invert mask colors + #[serde(skip_serializing_if = "Option::is_none")] + pub invert: Option, + /// IOU threshold for filtering the annotations + #[serde(skip_serializing_if = "Option::is_none")] + pub iou: Option, + /// Label for point, [1,0], 0 = background, 1 = foreground + #[serde(skip_serializing_if = "Option::is_none")] + pub point_label: Option>>, + /// Coordinates for multiple points [[x1,y1],[x2,y2]] + #[serde(skip_serializing_if = "Option::is_none")] + pub point_prompt: Option>>>>, + /// Draw high-resolution segmentation masks + #[serde(skip_serializing_if = "Option::is_none")] + pub retina: Option, + /// Image size + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// The prompt to use when generating masks + /// "a photo of elephant" + #[serde(skip_serializing_if = "Option::is_none")] + pub text_prompt: Option, + /// Draw the edges of the masks + #[serde(skip_serializing_if = "Option::is_none")] + pub with_contours: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SamOutput { + /// Combined image of all detected masks + #[serde(skip_serializing_if = "Option::is_none")] + pub image: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// Upscaling a face + #[serde(skip_serializing_if = "Option::is_none")] + pub face: Option, + /// Url to input image + /// "https://storage.googleapis.com/falserverless/model_tests/remove_background/elephant.jpg" + /// "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg" + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + pub image_url: String, + /// Model to use for upscaling + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Output image format (png or jpeg) + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Rescaling factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Tile size. Default is 0, that is no tile. When encountering the out-of-GPU-memory issue, please specify it, e.g., 400 or 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleOutput { + /// Upscaled image + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Midas Depth Estimation +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn sam(params: SamInput) -> FalRequest { + FalRequest::new("fal-ai/imageutils/sam", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/inpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/inpaint/mod.rs new file mode 100644 index 0000000000..986a27777f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/inpaint/mod.rs @@ -0,0 +1,105 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Input image for img2img or inpaint mode + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// Input mask for inpaint mode. Black areas will be preserved, white areas will be inpainted. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// URL or HuggingFace ID of the base model to generate the image. + /// "diffusers/stable-diffusion-xl-1.0-inpainting-0.1" + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, (worst quality, low quality, normal quality:2)" + /// "nsfw, cartoon, (epicnegative:0.9)" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a photo of a cat" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 1234 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct InpaintOutput { + /// The generated image files info. + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Inpainting sdxl and sd +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn inpaint(params: InpaintInput) -> FalRequest { + FalRequest::new("fal-ai/inpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/invisible_watermark/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/invisible_watermark/mod.rs new file mode 100644 index 0000000000..359b0a90dd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/invisible_watermark/mod.rs @@ -0,0 +1,73 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WatermarkInput { + /// URL of image to be watermarked + /// "https://storage.googleapis.com/falserverless/web-examples/watermark/watermark_ex.png" + pub image_url: String, + /// Text to use as watermark + /// "watermark" + #[serde(skip_serializing_if = "Option::is_none")] + pub watermark: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WatermarkOutput { + /// The watermarked image file info. + pub image: Image, +} + +/// Invisible Watermark +/// +/// Category: image-to-image +pub fn invisible_watermark(params: WatermarkInput) -> FalRequest { + FalRequest::new("fal-ai/invisible-watermark", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ip_adapter_face_id/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ip_adapter_face_id/mod.rs new file mode 100644 index 0000000000..c64a55b0d7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ip_adapter_face_id/mod.rs @@ -0,0 +1,134 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IpAdapterFaceIdInput { + /// The URL to the base 1.5 model. Default is SG161222/Realistic_Vision_V4.0_noVAE + #[serde(skip_serializing_if = "Option::is_none")] + pub base_1_5_model_repo: Option, + /// The URL to the base SDXL model. Default is SG161222/RealVisXL_V3.0 + #[serde(skip_serializing_if = "Option::is_none")] + pub base_sdxl_model_repo: Option, + /// The size of the face detection model. The higher the number the more accurate + /// the detection will be but it will also take longer to run. The higher the number the more + /// likely it will fail to find a face as well. Lower it if you are having trouble + /// finding a face in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub face_id_det_size: Option, + /// An image of a face to match. If an image with a size of 640x640 is not provided, it will be scaled and cropped to that size. + /// "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png" + #[serde(skip_serializing_if = "Option::is_none")] + pub face_image_url: Option, + /// URL to zip archive with images of faces. The images embedding will be averaged to + /// create a more accurate face id. + #[serde(skip_serializing_if = "Option::is_none")] + pub face_images_data_url: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The model type to use. 1_5 is the default and is recommended for most use cases. + /// "1_5-v1" + /// "1_5-v1-plus" + /// "1_5-v2-plus" + /// "SDXL-v1" + /// "SDXL-v2-plus" + /// "1_5-auraface-v1" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_type: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to use for generating the image. The more steps + /// the better the image will be but it will also take longer to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The number of samples for face id. The more samples the better the image will + /// be but it will also take longer to generate. Default is 4. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_samples: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct IpAdapterFaceIdOutput { + /// The generated image file info. + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// IP Adapter Face ID +/// +/// Category: image-to-image +/// Machine Type: A6000 +/// License Type: research +pub fn ip_adapter_face_id( + params: IpAdapterFaceIdInput, +) -> FalRequest { + FalRequest::new("fal-ai/ip-adapter-face-id", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/janus/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/janus/mod.rs new file mode 100644 index 0000000000..0a42d260b9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/janus/mod.rs @@ -0,0 +1,119 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JanusInput { + /// Classifier Free Guidance scale - how closely to follow the prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_weight: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// Number of images to generate in parallel. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt to generate an image from. + /// "beautiful girl, inside a house" + pub prompt: String, + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Controls randomness in the generation. Higher values make output more random. + #[serde(skip_serializing_if = "Option::is_none")] + pub temperature: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// DeepSeek Janus-Pro +/// +/// Category: text-to-image +pub fn janus(params: JanusInput) -> FalRequest { + FalRequest::new("fal-ai/janus", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/mod.rs new file mode 100644 index 0000000000..929fbe3420 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" + ))) +)] +pub mod v1_5; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/kolors_virtual_try_on/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/kolors_virtual_try_on/mod.rs new file mode 100644 index 0000000000..8ee51f99a3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/kolors_virtual_try_on/mod.rs @@ -0,0 +1,114 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TryOnOutput { + /// The output image. + /// {"content_type":"image/png","file_name":"result.png","file_size":595094,"height":1024,"url":"https://v3.fal.media/files/panda/Hoy3zhimzVKi3F2uoGBnh_result.png","width":768} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TryOnRequest { + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/tshirt_image.jpg" + pub garment_image_url: String, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/person_image.jpg" + pub human_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Kling Kolors Virtual TryOn v1.5 +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Kling Kolors Virtual Try-On +pub fn kolors_virtual_try_on(params: TryOnRequest) -> FalRequest { + FalRequest::new("fal-ai/kling/v1-5/kolors-virtual-try-on", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/mod.rs new file mode 100644 index 0000000000..00ddf757c0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling/v1_5/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" + ))) +)] +pub mod kolors_virtual_try_on; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/mod.rs new file mode 100644 index 0000000000..e7b7328051 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod v1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod v1_5; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod v1_6; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/mod.rs new file mode 100644 index 0000000000..3a56300e47 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod pro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod standard; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/effects/mod.rs new file mode 100644 index 0000000000..4f02da2738 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 (pro) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/pro/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/image_to_video/mod.rs new file mode 100644 index 0000000000..70a3bfb0dd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/image_to_video/mod.rs @@ -0,0 +1,241 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 (pro) Image to Video API. +pub fn image_to_video( + params: V1ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/pro/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/mod.rs new file mode 100644 index 0000000000..663141a2ca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/text_to_video/mod.rs new file mode 100644 index 0000000000..25cc1635d3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/pro/text_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 (pro) Text to Video API. +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/pro/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/effects/mod.rs new file mode 100644 index 0000000000..2bd4b70f33 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 (std) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/standard/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/image_to_video/mod.rs new file mode 100644 index 0000000000..97cfb45cc9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/image_to_video/mod.rs @@ -0,0 +1,241 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 Image to Video API. +pub fn image_to_video( + params: V1ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/standard/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/mod.rs new file mode 100644 index 0000000000..663141a2ca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/text_to_video/mod.rs new file mode 100644 index 0000000000..deb39b3c59 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1/standard/text_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.0 Text to Video API. +pub fn text_to_video(params: V1TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1/standard/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/mod.rs new file mode 100644 index 0000000000..3a56300e47 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod pro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod standard; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/effects/mod.rs new file mode 100644 index 0000000000..295c987306 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.5 (pro) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.5/pro/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/image_to_video/mod.rs new file mode 100644 index 0000000000..4741c276a5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/image_to_video/mod.rs @@ -0,0 +1,241 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.5 (pro) Image to Video API. +pub fn image_to_video( + params: ProImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.5/pro/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/mod.rs new file mode 100644 index 0000000000..663141a2ca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/text_to_video/mod.rs new file mode 100644 index 0000000000..b5da7370ff --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/pro/text_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.5 (pro) Text to Video API. +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.5/pro/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/effects/mod.rs new file mode 100644 index 0000000000..1060e8c58a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.5 (std) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.5/standard/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/mod.rs new file mode 100644 index 0000000000..26c189a042 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_5/standard/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/mod.rs new file mode 100644 index 0000000000..3a56300e47 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod pro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod standard; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/effects/mod.rs new file mode 100644 index 0000000000..f1882344f7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (pro) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/pro/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/image_to_video/mod.rs new file mode 100644 index 0000000000..c10d5d142e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/image_to_video/mod.rs @@ -0,0 +1,241 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (pro) Image to Video API. +pub fn image_to_video( + params: ProImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/pro/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/mod.rs new file mode 100644 index 0000000000..663141a2ca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/text_to_video/mod.rs new file mode 100644 index 0000000000..3659fca847 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/pro/text_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (pro) Text to Video API. +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/pro/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/effects/mod.rs new file mode 100644 index 0000000000..b4402cf912 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/effects/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (std) Effects API. +pub fn effects(params: VideoEffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/standard/effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/image_to_video/mod.rs new file mode 100644 index 0000000000..3f71239eb0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/image_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (std) Image to Video API. +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/standard/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/mod.rs new file mode 100644 index 0000000000..663141a2ca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/text_to_video/mod.rs new file mode 100644 index 0000000000..9e6e772b1f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kling_video/v1_6/standard/text_to_video/mod.rs @@ -0,0 +1,239 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CameraControl { + /// The type of camera movement + /// "horizontal" + pub movement_type: String, + /// The value of the camera movement + /// 10 + pub movement_value: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DynamicMask { + /// URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png" + pub mask_url: String, + /// List of trajectories + /// [{"x":279,"y":219},{"x":417,"y":65}] + #[serde(skip_serializing_if = "Option::is_none")] + pub trajectories: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/36087878b0c1435bb75c19b64b7db178_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KlingV1I2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/kangaroo/VUmAU3JvzS7mxwdgSU9zj_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ProImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/fb33a862b94d4d7195e610e4cbc5d392_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Trajectory { + /// X coordinate of the motion trajectory + /// 279 + pub x: i64, + /// Y coordinate of the motion trajectory + /// 219 + pub y: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1ImageToVideoRequest { + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of dynamic masks + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_masks: Option>>, + /// URL of the image to be used for the video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt for the video + /// "The astronaut stood up and walked away" + pub prompt: String, + /// URL of the image for Static Brush Application Area (Mask image created by users using the motion brush) + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub static_mask_url: Option, + /// URL of the image to be used for the end of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub tail_image_url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V1TextToVideoRequest { + /// Advanced Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub advanced_camera_control: Option>, + /// The aspect ratio of the generated video frame + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Camera control parameters + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_control: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_scale: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","url":"https://storage.googleapis.com/falserverless/kling/kling_ex.mp4.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoEffectsRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The effect scene to use for the video generation + /// "hug" + pub effect_scene: String, + /// URL of the image to be used for the squish and expansion video + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// URL of images to be used for hug, kiss or heart_gesture video. + /// ["https://storage.googleapis.com/falserverless/juggernaut_examples/VHXMavzPyI27zi6JseyL4.png","https://storage.googleapis.com/falserverless/juggernaut_examples/QEW5VrzccxGva7mPfEXjf.png"] + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, +} + +/// Kling 1.0 +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Kling 1.6 (std) Text to Video API. +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/kling-video/v1.6/standard/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/american_english/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/american_english/mod.rs new file mode 100644 index 0000000000..11c7f6e36e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/american_english/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn american_english(params: AmEnglishRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/american-english", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/brazilian_portuguese/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/brazilian_portuguese/mod.rs new file mode 100644 index 0000000000..54de7de5d7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/brazilian_portuguese/mod.rs @@ -0,0 +1,188 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn brazilian_portuguese( + params: BrPortugueseRequest, +) -> FalRequest { + FalRequest::new("fal-ai/kokoro/brazilian-portuguese", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/british_english/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/british_english/mod.rs new file mode 100644 index 0000000000..8a2ca9fd5c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/british_english/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn british_english(params: BrEnglishRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/british-english", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/french/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/french/mod.rs new file mode 100644 index 0000000000..fc0fa2f727 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/french/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn french(params: FrenchRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/french", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/hindi/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/hindi/mod.rs new file mode 100644 index 0000000000..0f81797f6e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/hindi/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn hindi(params: HindiRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/hindi", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/italian/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/italian/mod.rs new file mode 100644 index 0000000000..c0f98bd126 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/italian/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn italian(params: ItalianRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/italian", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/japanese/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/japanese/mod.rs new file mode 100644 index 0000000000..91b96d1fe5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/japanese/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn japanese(params: JapaneseRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/japanese", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mandarin_chinese/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mandarin_chinese/mod.rs new file mode 100644 index 0000000000..3a63389d4a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mandarin_chinese/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn mandarin_chinese(params: MandarinRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/mandarin-chinese", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mod.rs new file mode 100644 index 0000000000..45e236b011 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/mod.rs @@ -0,0 +1,313 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod american_english; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod brazilian_portuguese; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod british_english; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod french; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod hindi; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod italian; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod japanese; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod mandarin_chinese; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod spanish; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn kokoro(params: AmEnglishRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/spanish/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/spanish/mod.rs new file mode 100644 index 0000000000..0e3795c929 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kokoro/spanish/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/dXVMqWsBDG9yan3kaOT0Z_tmp0vvkha3s.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AmEnglishRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Voice ID for the desired voice. + /// "af_heart" + #[serde(skip_serializing_if = "Option::is_none")] + pub voice: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEngOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/4wpA60Kum6UjOVBKJoNyL_tmpxfrkn95k.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrEnglishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "bf_alice" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugeseOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/Y9-bWJt5lixo8PTCmncN6_tmpyh7u57oa.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BrPortugueseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "pf_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchOutput { + /// The generated music + /// {"url":"https://fal.media/files/kangaroo/E_itKJKZKRNaO-QtU77k1_tmpe1qso5xp.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FrenchRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ff_siwis" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/3sGUskl1AFG4TN_NAinO8_tmpdq_1m8og.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HindiRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "hf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/-MZ0hRO4IpTMukb_S5aRZ_tmpin14eoed.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ItalianRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "if_sara" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseOutput { + /// The generated music + /// {"url":"https://fal.media/files/lion/piLhqKO8LJxrWaNg2dVUv_tmpp6eff6zl.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct JapaneseRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "jf_alpha" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinOutput { + /// The generated music + /// {"url":"https://fal.media/files/rabbit/8UiqobkQXPrYDRHl4l5oU_tmptz6jo3ex.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MandarinRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "zf_xiaobei" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SpanishOutput { + /// The generated music + /// {"url":"https://fal.media/files/monkey/5rBM3qVCED73Lxs5XLcwj_tmp4f2z_qrf.wav"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SpanishRequest { + pub prompt: String, + /// Voice ID for the desired voice. + /// "ef_dora" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Kokoro TTS +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn spanish(params: SpanishRequest) -> FalRequest { + FalRequest::new("fal-ai/kokoro/spanish", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/image_to_image/mod.rs new file mode 100644 index 0000000000..35e6713d6b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/image_to_image/mod.rs @@ -0,0 +1,186 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KolorsImg2ImgInput { + /// Enable safety checker. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show + /// you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for image to image + /// "https://storage.googleapis.com/falserverless/model_tests/image_models/bunny_source.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small + /// details (e.g. moustache, blurry, low resolution). + /// "ugly, deformed, blurry" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "high quality image of a capybara wearing sunglasses. In the background of the image there are trees, poles, grass and other objects. At the bottom of the object there is the road., 8k, highly detailed." + pub prompt: String, + /// The scheduler to use for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// Seed + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for image-to-image. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and + /// uploaded before returning the response. This will increase the latency of + /// the function but it allows you to get the image directly in the response + /// without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KolorsInput { + /// Enable safety checker. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show + /// you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small + /// details (e.g. moustache, blurry, low resolution). + /// "ugly, deformed, blurry" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to use for generating the image. Be as descriptive as possible + /// for best results. + /// "A young Chinese couple with fair skin, dressed in stylish sportswear, with the modern Beijing city skyline in the background. Facial details, clear pores, captured using the latest camera model, close-up shot, ultra-high quality, 8K, visual feast." + /// "The image features four mythical beasts: Vermilion Bird, Black Tortoise, Azure Dragon, and White Tiger. The Vermilion Bird is at the top of the image, with feathers as red as fire and a tail as magnificent as a phoenix, its wings spreading like burning flames. The Black Tortoise is at the bottom, depicted as a giant turtle intertwined with a snake. Ancient runes adorn the turtle's shell, and the snake's eyes are cold and sharp. The Azure Dragon is on the right, its long body coiling in the sky, with jade-green scales, flowing whiskers, deer-like horns, and exhaling clouds and mist. The White Tiger is on the left, with a majestic posture, white fur with black stripes, piercing eyes, sharp teeth and claws, surrounded by vast mountains and grasslands." + pub prompt: String, + /// The scheduler to use for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// Seed + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and + /// uploaded before returning the response. This will increase the latency of + /// the function but it allows you to get the image directly in the response + /// without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Kolors +/// +/// Category: text-to-image +/// Machine Type: A6000 +/// License Type: commercial +pub fn image_to_image(params: KolorsImg2ImgInput) -> FalRequest { + FalRequest::new("fal-ai/kolors/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/mod.rs new file mode 100644 index 0000000000..2c184e355e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/kolors/mod.rs @@ -0,0 +1,201 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kolors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kolors" + ))) +)] +pub mod image_to_image; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KolorsImg2ImgInput { + /// Enable safety checker. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show + /// you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for image to image + /// "https://storage.googleapis.com/falserverless/model_tests/image_models/bunny_source.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small + /// details (e.g. moustache, blurry, low resolution). + /// "ugly, deformed, blurry" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "high quality image of a capybara wearing sunglasses. In the background of the image there are trees, poles, grass and other objects. At the bottom of the object there is the road., 8k, highly detailed." + pub prompt: String, + /// The scheduler to use for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// Seed + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for image-to-image. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and + /// uploaded before returning the response. This will increase the latency of + /// the function but it allows you to get the image directly in the response + /// without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct KolorsInput { + /// Enable safety checker. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show + /// you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small + /// details (e.g. moustache, blurry, low resolution). + /// "ugly, deformed, blurry" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to use for generating the image. Be as descriptive as possible + /// for best results. + /// "A young Chinese couple with fair skin, dressed in stylish sportswear, with the modern Beijing city skyline in the background. Facial details, clear pores, captured using the latest camera model, close-up shot, ultra-high quality, 8K, visual feast." + /// "The image features four mythical beasts: Vermilion Bird, Black Tortoise, Azure Dragon, and White Tiger. The Vermilion Bird is at the top of the image, with feathers as red as fire and a tail as magnificent as a phoenix, its wings spreading like burning flames. The Black Tortoise is at the bottom, depicted as a giant turtle intertwined with a snake. Ancient runes adorn the turtle's shell, and the snake's eyes are cold and sharp. The Azure Dragon is on the right, its long body coiling in the sky, with jade-green scales, flowing whiskers, deer-like horns, and exhaling clouds and mist. The White Tiger is on the left, with a majestic posture, white fur with black stripes, piercing eyes, sharp teeth and claws, surrounded by vast mountains and grasslands." + pub prompt: String, + /// The scheduler to use for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// Seed + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and + /// uploaded before returning the response. This will increase the latency of + /// the function but it allows you to get the image directly in the response + /// without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Kolors +/// +/// Category: text-to-image +/// Machine Type: A6000 +/// License Type: commercial +pub fn kolors(params: KolorsInput) -> FalRequest { + FalRequest::new("fal-ai/kolors", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/latentsync/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/latentsync/mod.rs new file mode 100644 index 0000000000..ee1c25b49c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/latentsync/mod.rs @@ -0,0 +1,115 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The URL of the audio to generate the lip sync for. + /// "https://fal.media/files/lion/vyFWygmZsIZlUO4s0nr2n.wav" + pub audio_url: String, + /// Guidance scale for the model inference + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Video loop mode when audio is longer than video. Options: pingpong, loop + #[serde(skip_serializing_if = "Option::is_none")] + pub loop_mode: Option, + /// Random seed for generation. If None, a random seed will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the video to generate the lip sync for. + /// "https://fal.media/files/koala/8teUPbRRMtAUTORDvqy0l.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated video with the lip sync. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum LoopModeProperty { + #[default] + #[serde(rename = "pingpong")] + Pingpong, + #[serde(rename = "loop")] + Loop, + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// LatentSync +/// +/// Category: video-to-video +/// +/// License Type: commercial +pub fn latentsync(params: Input) -> FalRequest { + FalRequest::new("fal-ai/latentsync", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/layer_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/layer_diffusion/mod.rs new file mode 100644 index 0000000000..29dd170dc7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/layer_diffusion/mod.rs @@ -0,0 +1,96 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ComfyInput { + /// Disable saving prompt metadata in files. + #[serde(skip_serializing_if = "Option::is_none")] + pub disable_metadata: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub extra_data: Option>, + pub prompt: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The guidance scale for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The prompt to use for generating the negative image. Be as descriptive as possible for best results. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a male army soldier holding a gun" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The URL of the generated image. + pub image: Image, + /// The seed used to generate the image. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Layer Diffusion XL +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn layer_diffusion(params: Input) -> FalRequest { + FalRequest::new("fal-ai/layer-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm/mod.rs new file mode 100644 index 0000000000..6f33119e16 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm/mod.rs @@ -0,0 +1,208 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LCMInput { + /// If set to true, the inpainting pipeline will use controlnet inpainting. + /// Only effective for inpainting pipelines. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_inpaint: Option, + /// If set to true, the resulting image will be checked whether it includes any + /// potentially unsafe content. If it does, it will be replaced with a black + /// image. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checks: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. You can choose between some presets or + /// custom height and width that **must be multiples of 8**. + /// + /// If not provided: + /// - For text-to-image generations, the default size is 512x512. + /// - For image-to-image generations, the default size is the same as the input image. + /// - For inpainting generations, the default size is the same as the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The base image to use for guiding the image generation on image-to-image + /// generations. If the either width or height of the image is larger than 1024 + /// pixels, the image will be resized to 1024 pixels while keeping the aspect ratio. + /// "https://storage.googleapis.com/falserverless/model_tests/lcm/inpaint_image.png" + /// "https://storage.googleapis.com/falserverless/model_tests/lcm/beach.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// If set to true, the inpainting pipeline will only inpaint the provided mask + /// area. Only effective for inpainting pipelines. + #[serde(skip_serializing_if = "Option::is_none")] + pub inpaint_mask_only: Option, + /// The scale of the lora server to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub lora_scale: Option, + /// The url of the lora server to use for image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub lora_url: Option, + /// The mask to use for guiding the image generation on image + /// inpainting. The model will focus on the mask area and try to fill it with + /// the most relevant content. + /// + /// The mask must be a black and white image where the white area is the area + /// that needs to be filled and the black area is the area that should be + /// ignored. + /// + /// The mask must have the same dimensions as the image passed as `image_url`. + /// "https://storage.googleapis.com/falserverless/model_tests/lcm/inpaint_mask.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// The model to use for generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. The function will return a list of images + /// with the same prompt and negative prompt but different seeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to use for generating the image. The more steps + /// the better the image will be but it will also take longer to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a black cat with glowing eyes, cute, adorable, disney, pixar, highly detailed, 8k" + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the image that is passed as `image_url`. The strength + /// determines how much the generated image will be similar to the image passed as + /// `image_url`. The higher the strength the more model gets "creative" and + /// generates an image that's different from the initial image. A strength of 1.0 + /// means that the initial image is more or less ignored and the model will try to + /// generate an image that's as close as possible to the prompt. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LCMOutput { + /// The generated image files info. + pub images: Vec, + /// A list of booleans indicating whether the generated image contains any + /// potentially unsafe content. If the safety check is disabled, this field + /// will all will be false. + pub nsfw_content_detected: Vec, + /// Number of inference steps used to generate the image. It will be the same value of the one passed in the + /// input or the default one in case none was passed. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Latent Consistency (SDXL & SDv1.5) +/// +/// Category: text-to-image +/// Machine Type: A100 +/// +/// +/// Generates an image using the given prompt and model. +/// +/// If only the prompt is given, the model will generate an image from scratch, this +/// process is also known as "text-to-image". +/// +/// If an image is given (via `image_url` parameter), the model will generate an image +/// that's similar to the given image depending on the `strength` parameter. This +/// process is also known as "image-to-image". +/// +/// If an image and a mask are given (via `image_url` and `mask_url` parameters), the +/// model will generate an image that fills the mask area with the most relevant +/// content from the given image. This process is also known as "inpainting". +pub fn lcm(params: LCMInput) -> FalRequest { + FalRequest::new("fal-ai/lcm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm_sd15_i2i/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm_sd15_i2i/mod.rs new file mode 100644 index 0000000000..05acc10b2f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lcm_sd15_i2i/mod.rs @@ -0,0 +1,117 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LCMI2IInput { + /// If set to true, the resulting image will be checked whether it includes any + /// potentially unsafe content. If it does, it will be replaced with a black + /// image. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checks: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The image to use as a base. + /// "https://storage.googleapis.com/falserverless/model_tests/lcm/beach.png" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. The function will return a list of images + /// with the same prompt and negative prompt but different seeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to use for generating the image. The more steps + /// the better the image will be but it will also take longer to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "masterpiece, colorful, photo of a beach in hawaii, sun" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LCMOutput { + /// The generated image files info. + pub images: Vec, + /// A list of booleans indicating whether the generated image contains any + /// potentially unsafe content. If the safety check is disabled, this field + /// will have a false for each generated image. + pub nsfw_content_detected: Vec, + /// Number of inference steps used to generate the image. It will be the same value of the one passed in the + /// input or the default one in case none was passed. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Optimized Latent Consistency (SDv1.5) +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn lcm_sd15_i2i(params: LCMI2IInput) -> FalRequest { + FalRequest::new("fal-ai/lcm-sd15-i2i", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/mod.rs new file mode 100644 index 0000000000..3d9a3e1068 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" + ))) +)] +pub mod pose_transfer; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" + ))) +)] +pub mod virtual_tryon; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/pose_transfer/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/pose_transfer/mod.rs new file mode 100644 index 0000000000..47282b839d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/pose_transfer/mod.rs @@ -0,0 +1,146 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PoseTransferInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your input when generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/pose_image.jpg" + pub person_image_url: String, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/person_image.jpg" + pub pose_image_url: String, + /// The same seed and the same input given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PoseTransferOutput { + /// Whether the image contains NSFW concepts. + pub has_nsfw_concepts: bool, + /// The output image. + /// {"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/tiger/y6ZwaYdP9Q92FnsJcSbYz.png","width":768} + pub image: Image, + /// The seed for the inference. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VTONInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/tshirt_image.jpg" + pub garment_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your input when generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/person_image.jpg" + pub human_image_url: String, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The same seed and the same input given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VTONOutput { + /// Whether the image contains NSFW concepts. + pub has_nsfw_concepts: bool, + /// The output image. + /// {"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/elephant/9NTQQNo9eyiQUSLa6cYBW.png","width":768} + pub image: Image, + /// The seed for the inference. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Leffa Virtual TryOn +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn pose_transfer( + params: PoseTransferInput, +) -> FalRequest { + FalRequest::new("fal-ai/leffa/pose-transfer", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/virtual_tryon/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/virtual_tryon/mod.rs new file mode 100644 index 0000000000..d9b213a676 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/leffa/virtual_tryon/mod.rs @@ -0,0 +1,144 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PoseTransferInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your input when generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/pose_image.jpg" + pub person_image_url: String, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/person_image.jpg" + pub pose_image_url: String, + /// The same seed and the same input given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PoseTransferOutput { + /// Whether the image contains NSFW concepts. + pub has_nsfw_concepts: bool, + /// The output image. + /// {"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/tiger/y6ZwaYdP9Q92FnsJcSbYz.png","width":768} + pub image: Image, + /// The seed for the inference. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VTONInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Url to the garment image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/tshirt_image.jpg" + pub garment_image_url: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your input when generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Url for the human image. + /// "https://storage.googleapis.com/falserverless/model_tests/leffa/person_image.jpg" + pub human_image_url: String, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The same seed and the same input given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VTONOutput { + /// Whether the image contains NSFW concepts. + pub has_nsfw_concepts: bool, + /// The output image. + /// {"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/elephant/9NTQQNo9eyiQUSLa6cYBW.png","width":768} + pub image: Image, + /// The seed for the inference. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Leffa Virtual TryOn +/// +/// Category: image-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn virtual_tryon(params: VTONInput) -> FalRequest { + FalRequest::new("fal-ai/leffa/virtual-tryon", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/image_to_image/mod.rs new file mode 100644 index 0000000000..36a90f5eed --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/image_to_image/mod.rs @@ -0,0 +1,307 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Lightning Models +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: LightningModelsImageToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/lightning-models/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/inpainting/mod.rs new file mode 100644 index 0000000000..c9d070e55b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/inpainting/mod.rs @@ -0,0 +1,307 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Lightning Models +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting( + params: LightningModelsInpaintingInput, +) -> FalRequest { + FalRequest::new("fal-ai/lightning-models/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/mod.rs new file mode 100644 index 0000000000..9529b371f5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lightning_models/mod.rs @@ -0,0 +1,336 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LightningModelsTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Lightning model to use. + /// "Lykon/dreamshaper-xl-lightning" + /// "SG161222/RealVisXL_V4.0_Lightning" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Lightning Models +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn lightning_models( + params: LightningModelsTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/lightning-models", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/image/mod.rs new file mode 100644 index 0000000000..6fb11f508f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/image/mod.rs @@ -0,0 +1,272 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitImageInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Output format + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LivePortraitImageOutput { + /// The generated image file. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Batch size for the model. The larger the batch size, the faster the model will run, but the more memory it will consume. + #[serde(skip_serializing_if = "Option::is_none")] + pub batch_size: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to enable eye retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_eye_retargeting: Option, + /// Whether to enable lip retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_retargeting: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// Whether to use relative motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_relative: Option, + /// Whether to enable stitching. Recommended to set to True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_stitching: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub video_url: String, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitOutput { + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitVideoInput { + /// Whether to prioritize source or driving audio. + #[serde(skip_serializing_if = "Option::is_none")] + pub audio_priority: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub driving_video_url: String, + /// Whether to filter out NSFW content. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/videos/s13.mp4" + pub source_video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Live Portrait +/// +/// Category: image-to-video +/// Machine Type: A6000 +/// License Type: commercial +pub fn image( + params: LivePortraitImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/live-portrait/image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/mod.rs new file mode 100644 index 0000000000..a1ecf1ae11 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/mod.rs @@ -0,0 +1,301 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" + ))) +)] +pub mod image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" + ))) +)] +pub mod video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitImageInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Output format + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitImageOutput { + /// The generated image file. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Batch size for the model. The larger the batch size, the faster the model will run, but the more memory it will consume. + #[serde(skip_serializing_if = "Option::is_none")] + pub batch_size: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to enable eye retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_eye_retargeting: Option, + /// Whether to enable lip retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_retargeting: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// Whether to use relative motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_relative: Option, + /// Whether to enable stitching. Recommended to set to True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_stitching: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub video_url: String, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LivePortraitOutput { + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitVideoInput { + /// Whether to prioritize source or driving audio. + #[serde(skip_serializing_if = "Option::is_none")] + pub audio_priority: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub driving_video_url: String, + /// Whether to filter out NSFW content. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/videos/s13.mp4" + pub source_video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Live Portrait +/// +/// Category: image-to-video +/// Machine Type: A6000 +/// License Type: commercial +pub fn live_portrait( + params: LivePortraitInput, +) -> FalRequest { + FalRequest::new("fal-ai/live-portrait", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/video/mod.rs new file mode 100644 index 0000000000..85f343748a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/live_portrait/video/mod.rs @@ -0,0 +1,272 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitImageInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Output format + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitImageOutput { + /// The generated image file. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitInput { + /// Amount to open mouth in 'aaa' shape + #[serde(skip_serializing_if = "Option::is_none")] + pub aaa: Option, + /// Batch size for the model. The larger the batch size, the faster the model will run, but the more memory it will consume. + #[serde(skip_serializing_if = "Option::is_none")] + pub batch_size: Option, + /// Amount to blink the eyes + #[serde(skip_serializing_if = "Option::is_none")] + pub blink: Option, + /// Size of the output image. + #[serde(skip_serializing_if = "Option::is_none")] + pub dsize: Option, + /// Amount to shape mouth in 'eee' position + #[serde(skip_serializing_if = "Option::is_none")] + pub eee: Option, + /// Whether to enable the safety checker. If enabled, the model will check if the input image contains a face before processing it. + /// The safety checker will process the input image + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Amount to raise or lower eyebrows + #[serde(skip_serializing_if = "Option::is_none")] + pub eyebrow: Option, + /// Whether to crop the source portrait to the face-cropping space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_crop: Option, + /// Whether to conduct the rotation when flag_do_crop is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_do_rot: Option, + /// Whether to enable eye retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_eye_retargeting: Option, + /// Whether to enable lip retargeting. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_retargeting: Option, + /// Whether to set the lip to closed state before animation. Only takes effect when flag_eye_retargeting and flag_lip_retargeting are False. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_lip_zero: Option, + /// Whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_pasteback: Option, + /// Whether to use relative motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_relative: Option, + /// Whether to enable stitching. Recommended to set to True. + #[serde(skip_serializing_if = "Option::is_none")] + pub flag_stitching: Option, + /// URL of the image to be animated + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/XKEmk3mAzGHUjK3qqH-UL.jpeg" + pub image_url: String, + /// Amount to move pupils horizontally + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_x: Option, + /// Amount to move pupils vertically + #[serde(skip_serializing_if = "Option::is_none")] + pub pupil_y: Option, + /// Amount to rotate the face in pitch + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_pitch: Option, + /// Amount to rotate the face in roll + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_roll: Option, + /// Amount to rotate the face in yaw + #[serde(skip_serializing_if = "Option::is_none")] + pub rotate_yaw: Option, + /// Scaling factor for the face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// Amount to smile + #[serde(skip_serializing_if = "Option::is_none")] + pub smile: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub video_url: String, + /// Horizontal offset ratio for face crop. + #[serde(skip_serializing_if = "Option::is_none")] + pub vx_ratio: Option, + /// Vertical offset ratio for face crop. Positive values move up, negative values move down. + #[serde(skip_serializing_if = "Option::is_none")] + pub vy_ratio: Option, + /// Amount to wink + #[serde(skip_serializing_if = "Option::is_none")] + pub wink: Option, + /// Amount to shape mouth in 'woo' position + #[serde(skip_serializing_if = "Option::is_none")] + pub woo: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LivePortraitOutput { + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LivePortraitVideoInput { + /// Whether to prioritize source or driving audio. + #[serde(skip_serializing_if = "Option::is_none")] + pub audio_priority: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/model_tests/live-portrait/liveportrait-example.mp4" + pub driving_video_url: String, + /// Whether to filter out NSFW content. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// URL of the video to drive the lip syncing. + /// "https://storage.googleapis.com/falserverless/videos/s13.mp4" + pub source_video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Live Portrait +/// +/// Category: image-to-video +/// Machine Type: A6000 +/// License Type: commercial +pub fn video( + params: LivePortraitVideoInput, +) -> FalRequest { + FalRequest::new("fal-ai/live-portrait/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/llava_next/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/llava_next/mod.rs new file mode 100644 index 0000000000..a5e24e00d5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/llava_next/mod.rs @@ -0,0 +1,58 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LLavaInput { + /// URL of the image to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Prompt to be used for the image + /// "Do you know who drew this painting?" + pub prompt: String, + /// Temperature for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub temperature: Option, + /// Top P for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub top_p: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LLavaOutput { + /// Generated output + /// "Leonardo da Vinci" + pub output: String, + /// Whether the output is partial + #[serde(skip_serializing_if = "Option::is_none")] + pub partial: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// LLaVA v1.6 34B +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: research +pub fn llava_next(params: LLavaInput) -> FalRequest { + FalRequest::new("fal-ai/llava-next", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/llavav15_13b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/llavav15_13b/mod.rs new file mode 100644 index 0000000000..3039c7df45 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/llavav15_13b/mod.rs @@ -0,0 +1,57 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LLavaInput { + /// URL of the image to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Prompt to be used for the image + /// "Do you know who drew this painting?" + pub prompt: String, + /// Temperature for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub temperature: Option, + /// Top P for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub top_p: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LLavaOutput { + /// Generated output + /// "Leonardo da Vinci" + pub output: String, + /// Whether the output is partial + #[serde(skip_serializing_if = "Option::is_none")] + pub partial: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// LLaVA v1.5 13B +/// +/// Category: vision +/// Machine Type: A6000 +pub fn llavav15_13b(params: LLavaInput) -> FalRequest { + FalRequest::new("fal-ai/llavav15-13b", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/image_to_image/mod.rs new file mode 100644 index 0000000000..39fac46b4f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/image_to_image/mod.rs @@ -0,0 +1,673 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the image to be used as the control net. + pub image_url: String, + /// The index of the IP adapter to be applied to the controlnet. This is only needed for InstantID ControlNets. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_index: Option, + /// The mask to use for the controlnet. When using a mask, the control image size and the mask size must be the same and divisible by 32. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + pub path: String, + /// The tokens to map the embedding weights to. Use these tokens in your prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// The value to set the image projection shortcut to. For FaceID plus V1 models, + /// this should be set to False. For FaceID plus V2 models, this should be set to True. + /// Default is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_projection_shortcut: Option, + /// URL or the path to the InsightFace model weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub insight_face_model_path: Option, + /// URL of the image to be used as the IP adapter. + pub ip_adapter_image_url: IpAdapterImageUrlProperty, + /// The mask to use for the IP adapter. When using a mask, the ip-adapter image size and the mask size must be the same + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_mask_url: Option, + /// Subfolder in the model directory where the IP adapter weights are stored. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_subfolder: Option, + /// URL or the path to the IP adapter weights. + pub path: String, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale_json: Option>, + /// The factor to apply to the unconditional noising of the IP adapter. + #[serde(skip_serializing_if = "Option::is_none")] + pub unconditional_noising_factor: Option, + /// Name of the weight file. + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of black-and-white image to use as mask during inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputParameters { + /// The latents saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option>, + /// The latents saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option>, + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SigmasInput { + /// Sigmas schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the sigmas. If set to 'custom', the sigmas will be set based + /// on the provided sigmas schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the sigmas of the scheduler. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// The size of the generated image. You can choose between some presets or custom height and width + /// that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TimestepsInput { + /// Timesteps schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the timesteps. If set to 'array', the timesteps will be set based + /// on the provided timesteps schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the `num_inference_steps` parameter. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum IpAdapterImageUrlProperty { + #[default] + String(String), + Array(Vec), +} + +/// Stable Diffusion with LoRAs +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: ImageToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/lora/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/inpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/inpaint/mod.rs new file mode 100644 index 0000000000..34e6bbf2d4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/inpaint/mod.rs @@ -0,0 +1,671 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the image to be used as the control net. + pub image_url: String, + /// The index of the IP adapter to be applied to the controlnet. This is only needed for InstantID ControlNets. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_index: Option, + /// The mask to use for the controlnet. When using a mask, the control image size and the mask size must be the same and divisible by 32. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + pub path: String, + /// The tokens to map the embedding weights to. Use these tokens in your prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// The value to set the image projection shortcut to. For FaceID plus V1 models, + /// this should be set to False. For FaceID plus V2 models, this should be set to True. + /// Default is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_projection_shortcut: Option, + /// URL or the path to the InsightFace model weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub insight_face_model_path: Option, + /// URL of the image to be used as the IP adapter. + pub ip_adapter_image_url: IpAdapterImageUrlProperty, + /// The mask to use for the IP adapter. When using a mask, the ip-adapter image size and the mask size must be the same + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_mask_url: Option, + /// Subfolder in the model directory where the IP adapter weights are stored. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_subfolder: Option, + /// URL or the path to the IP adapter weights. + pub path: String, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale_json: Option>, + /// The factor to apply to the unconditional noising of the IP adapter. + #[serde(skip_serializing_if = "Option::is_none")] + pub unconditional_noising_factor: Option, + /// Name of the weight file. + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of black-and-white image to use as mask during inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputParameters { + /// The latents saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option>, + /// The latents saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option>, + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SigmasInput { + /// Sigmas schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the sigmas. If set to 'custom', the sigmas will be set based + /// on the provided sigmas schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the sigmas of the scheduler. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// The size of the generated image. You can choose between some presets or custom height and width + /// that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TimestepsInput { + /// Timesteps schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the timesteps. If set to 'array', the timesteps will be set based + /// on the provided timesteps schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the `num_inference_steps` parameter. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum IpAdapterImageUrlProperty { + #[default] + String(String), + Array(Vec), +} + +/// Stable Diffusion with LoRAs +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpaint(params: InpaintInput) -> FalRequest { + FalRequest::new("fal-ai/lora/inpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/mod.rs new file mode 100644 index 0000000000..5b43c26784 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lora/mod.rs @@ -0,0 +1,700 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" + ))) +)] +pub mod inpaint; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// optional URL to the controlnet config.json file. + #[serde(skip_serializing_if = "Option::is_none")] + pub config_url: Option, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL of the image to be used as the control net. + pub image_url: String, + /// The index of the IP adapter to be applied to the controlnet. This is only needed for InstantID ControlNets. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_index: Option, + /// The mask to use for the controlnet. When using a mask, the control image size and the mask size must be the same and divisible by 32. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, + /// The optional variant if a Hugging Face repo key is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + pub path: String, + /// The tokens to map the embedding weights to. Use these tokens in your prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// The value to set the image projection shortcut to. For FaceID plus V1 models, + /// this should be set to False. For FaceID plus V2 models, this should be set to True. + /// Default is True. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_projection_shortcut: Option, + /// URL or the path to the InsightFace model weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub insight_face_model_path: Option, + /// URL of the image to be used as the IP adapter. + pub ip_adapter_image_url: IpAdapterImageUrlProperty, + /// The mask to use for the IP adapter. When using a mask, the ip-adapter image size and the mask size must be the same + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter_mask_url: Option, + /// Subfolder in the model directory where the IP adapter weights are stored. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_subfolder: Option, + /// URL or the path to the IP adapter weights. + pub path: String, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// The scale of the IP adapter weight. This is used to scale the IP adapter weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale_json: Option>, + /// The factor to apply to the unconditional noising of the IP adapter. + #[serde(skip_serializing_if = "Option::is_none")] + pub unconditional_noising_factor: Option, + /// Name of the weight file. + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// URL of image to use for image to image/inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of black-and-white image to use as mask during inpainting. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The amount of noise to add to noise image for image. Only used if the image_url is provided. 1.0 is complete noise and 0 is no noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_strength: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputParameters { + /// The latents saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option>, + /// The latents saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option>, + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SigmasInput { + /// Sigmas schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the sigmas. If set to 'custom', the sigmas will be set based + /// on the provided sigmas schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the sigmas of the scheduler. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Skips part of the image generation process, leading to slightly different results. + /// This means the image renders faster, too. + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_skip: Option, + /// If set to true, the controlnet will be applied to only the conditional predictions. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_guess_mode: Option, + /// The control nets to use for the image generation. You can use any number of control nets + /// and they will be applied to the image at the specified timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnets: Option>>, + /// If set to true, the latents will be saved for debugging. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_latents: Option, + /// If set to true, the latents will be saved for debugging per pass. + #[serde(skip_serializing_if = "Option::is_none")] + pub debug_per_pass_latents: Option, + /// The embeddings to use for the image generation. Only a single embedding is supported at the moment. + /// The embeddings will be used to map the tokens in the prompt to the embedding weights. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The eta value to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub eta: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the IC Light model image to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_image_url: Option, + /// The URL of the IC Light model background image to use for the image generation. + /// Make sure to use a background compatible with the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_background_image_url: Option, + /// The URL of the IC Light model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ic_light_model_url: Option, + /// The path to the image encoder model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_path: Option, + /// The subfolder of the image encoder model to use for the image generation. + + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// The weight name of the image encoder model to use for the image generation. + /// "pytorch_model.bin" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// The format of the generated image. + /// "jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_format: Option, + /// The size of the generated image. You can choose between some presets or custom height and width + /// that **must be multiples of 8**. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The IP adapter to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL or HuggingFace ID of the base model to generate the image. + /// "stabilityai/stable-diffusion-xl-base-1.0" + /// "runwayml/stable-diffusion-v1-5" + /// "SG161222/Realistic_Vision_V2.0" + pub model_name: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, painting, illustration, worst quality, low quality, normal quality" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The type of prediction to use for the image generation. + /// The `epsilon` is the default. + #[serde(skip_serializing_if = "Option::is_none")] + pub prediction_type: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photo of a european medieval 40 year old queen, silver hair, highly detailed face, detailed eyes, head shot, intricate crown, age spots, wrinkles" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// If set to true, the prompt weighting syntax will be used. + /// Additionally, this will lift the 77 token limit by averaging embeddings. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_weighting: Option, + /// Whether to set the rescale_betas_snr_zero option or not for the sampler + #[serde(skip_serializing_if = "Option::is_none")] + pub rescale_betas_snr_zero: Option, + /// Scheduler / sampler to use for the image denoising process. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Optionally override the sigmas to use for the denoising process. Only works with schedulers which support the `sigmas` argument in their `set_sigmas` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the sigmas based on the `num_inference_steps` parameter. + /// If set to a custom sigma schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `timesteps` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub sigmas: Option>, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_height: Option, + /// The stride of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_stride_width: Option, + /// The size of the tiles to be used for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub tile_width: Option, + /// Optionally override the timesteps to use for the denoising process. Only works with schedulers which support the `timesteps` argument in their `set_timesteps` method. + /// Defaults to not overriding, in which case the scheduler automatically sets the timesteps based on the `num_inference_steps` parameter. + /// If set to a custom timestep schedule, the `num_inference_steps` parameter will be ignored. Cannot be set if `sigmas` is set. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option>, + /// URL or HuggingFace ID of the custom U-Net model to use for the image generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub unet_name: Option, + /// The variant of the model to use for huggingface models, e.g. 'fp16'. + #[serde(skip_serializing_if = "Option::is_none")] + pub variant: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TimestepsInput { + /// Timesteps schedule to be used if 'custom' method is selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub array: Option>>, + /// The method to use for the timesteps. If set to 'array', the timesteps will be set based + /// on the provided timesteps schedule in the `array` field. + /// Defaults to 'default' which means the scheduler will use the `num_inference_steps` parameter. + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum IpAdapterImageUrlProperty { + #[default] + String(String), + Array(Vec), +} + +/// Stable Diffusion with LoRAs +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn lora(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/image_to_video/mod.rs new file mode 100644 index 0000000000..2e32c39e7a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/image_to_video/mod.rs @@ -0,0 +1,120 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The guidance scale to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate the video from. + /// "https://fal.media/files/kangaroo/4OePu2ifG7SKxTM__TQrQ_72929fec9fb74790bb8c8b760450c9b9.jpg" + pub image_url: String, + /// The negative prompt to generate the video from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to take. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A lone astronaut in a white spacesuit with gold-tinted visor drifts weightlessly through a sleek, cylindrical corridor of a spaceship. Their movements are slow and graceful as they gently push off the metallic walls with their gloved hands, rotating slightly as they float from right to left across the frame. The corridor features brushed aluminum panels with blue LED strips running along the ceiling, casting a cool glow on the astronaut's suit. Various cables, pipes, and control panels line the walls. The camera follows the astronaut's movement in a handheld style, slightly swaying and adjusting focus, maintaining a medium shot that captures both the astronaut and the corridor's depth. Small particles of dust catch the light as they float in the zero-gravity environment. The scene appears cinematic, with lens flares occasionally reflecting off the metallic surfaces and the astronaut's visor." + pub prompt: String, + /// The seed to use for random number generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The seed used for random number generation. + pub seed: i64, + /// The generated video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// The guidance scale to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The negative prompt to generate the video from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to take. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A man stands waist-deep in a crystal-clear mountain pool, his back turned to a massive, thundering waterfall that cascades down jagged cliffs behind him. He wears a dark blue swimming shorts and his muscular back glistens with water droplets. The camera moves in a dynamic circular motion around him, starting from his right side and sweeping left, maintaining a slightly low angle that emphasizes the towering height of the waterfall. As the camera moves, the man slowly turns his head to follow its movement, his expression one of awe as he gazes up at the natural wonder. The waterfall creates a misty atmosphere, with sunlight filtering through the spray to create rainbow refractions. The water churns and ripples around him, reflecting the dramatic landscape. The handheld camera movement adds a subtle shake that enhances the raw, untamed energy of the scene. The lighting is natural and bright, with the sun positioned behind the waterfall, creating a backlit effect that silhouettes the falling water and illuminates the mist." + pub prompt: String, + /// The seed to use for random number generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// LTX Video (preview) +/// +/// Category: text-to-video +/// Machine Type: H100 +/// License Type: research +/// +/// LTX Video - Image to Video generation +/// +/// See examples for more inspiration. Use the `image_url` parameter to provide an image to generate the video from. Make sure it is 768x512. +/// +/// ### Instructions +/// When writing prompts, focus on detailed, chronological descriptions of actions and scenes. Include specific movements, +/// appearances, camera angles, and environmental details - all in a single flowing paragraph. Start directly with the action, +/// and keep descriptions literal and precise. Think like a cinematographer describing a shot list. Keep within 200 words. For +/// best results, build your prompts using this structure: +/// * Start with main action in a single sentence +/// * Add specific details about movements and gestures +/// * Describe character/object appearances precisely +/// * Include background and environment details +/// * Specify camera angles and movements +/// * Describe lighting and colors +/// * Note any changes or sudden events +/// +/// ### Parameter Guide +/// * Guidance Scale: Higher values (5-7) for accurate prompt following, lower values (3-5) for more creative freedom +/// * Inference Steps: More steps (40+) for quality, fewer steps (20-30) for speed +pub fn image_to_video(params: ImageToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/ltx-video/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/mod.rs new file mode 100644 index 0000000000..5da74c8dca --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video/mod.rs @@ -0,0 +1,135 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The guidance scale to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate the video from. + /// "https://fal.media/files/kangaroo/4OePu2ifG7SKxTM__TQrQ_72929fec9fb74790bb8c8b760450c9b9.jpg" + pub image_url: String, + /// The negative prompt to generate the video from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to take. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A lone astronaut in a white spacesuit with gold-tinted visor drifts weightlessly through a sleek, cylindrical corridor of a spaceship. Their movements are slow and graceful as they gently push off the metallic walls with their gloved hands, rotating slightly as they float from right to left across the frame. The corridor features brushed aluminum panels with blue LED strips running along the ceiling, casting a cool glow on the astronaut's suit. Various cables, pipes, and control panels line the walls. The camera follows the astronaut's movement in a handheld style, slightly swaying and adjusting focus, maintaining a medium shot that captures both the astronaut and the corridor's depth. Small particles of dust catch the light as they float in the zero-gravity environment. The scene appears cinematic, with lens flares occasionally reflecting off the metallic surfaces and the astronaut's visor." + pub prompt: String, + /// The seed to use for random number generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The seed used for random number generation. + pub seed: i64, + /// The generated video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// The guidance scale to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The negative prompt to generate the video from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to take. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A man stands waist-deep in a crystal-clear mountain pool, his back turned to a massive, thundering waterfall that cascades down jagged cliffs behind him. He wears a dark blue swimming shorts and his muscular back glistens with water droplets. The camera moves in a dynamic circular motion around him, starting from his right side and sweeping left, maintaining a slightly low angle that emphasizes the towering height of the waterfall. As the camera moves, the man slowly turns his head to follow its movement, his expression one of awe as he gazes up at the natural wonder. The waterfall creates a misty atmosphere, with sunlight filtering through the spray to create rainbow refractions. The water churns and ripples around him, reflecting the dramatic landscape. The handheld camera movement adds a subtle shake that enhances the raw, untamed energy of the scene. The lighting is natural and bright, with the sun positioned behind the waterfall, creating a backlit effect that silhouettes the falling water and illuminates the mist." + pub prompt: String, + /// The seed to use for random number generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// LTX Video (preview) +/// +/// Category: text-to-video +/// Machine Type: H100 +/// License Type: research +/// +/// LTX Video - Text to Video generation +/// +/// See examples for more inspiration. +/// +/// ### Instructions +/// When writing prompts, focus on detailed, chronological descriptions of actions and scenes. Include specific movements, +/// appearances, camera angles, and environmental details - all in a single flowing paragraph. Start directly with the action, +/// and keep descriptions literal and precise. Think like a cinematographer describing a shot list. Keep within 200 words. For +/// best results, build your prompts using this structure: +/// * Start with main action in a single sentence +/// * Add specific details about movements and gestures +/// * Describe character/object appearances precisely +/// * Include background and environment details +/// * Specify camera angles and movements +/// * Describe lighting and colors +/// * Note any changes or sudden events +/// +/// ### Parameter Guide +/// * Guidance Scale: Higher values (5-7) for accurate prompt following, lower values (3-5) for more creative freedom +/// * Inference Steps: More steps (40+) for quality, fewer steps (20-30) for speed +pub fn ltx_video(params: TextToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/ltx-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/extend/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/extend/mod.rs new file mode 100644 index 0000000000..c7ab6e8e5c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/extend/mod.rs @@ -0,0 +1,217 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "Woman walking on a street in Tokyo" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Video to be extended. + /// {"start_frame_num":24,"video_url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: VideoConditioningInput, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ExtendVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-v095_extend.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageConditioningInput { + /// URL of image to use as conditioning + pub image_url: String, + /// Frame number of the image from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Image URL for Image-to-Video task + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "The astronaut gets up and walks away" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx_i2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiConditioningVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// URL of images to use as conditioning + /// [{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/NswO1P8sCLzrh1WefqQFK_9a6bdbfa54b944c9a770338159a113fd.jpg","start_frame_num":0},{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/YAPOGvmS2tM_Krdp7q6-d_267c97e017c34f679844a4477dfcec38.jpg","start_frame_num":120}] + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option>>, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "\n A vibrant, abstract composition featuring a person with outstretched arms, rendered in a kaleidoscope of colors against a deep, dark background. The figure is composed of intricate, swirling patterns reminiscent of a mosaic, with hues of orange, yellow, blue, and green that evoke the style of artists such as Wassily Kandinsky or Bridget Riley. \n\nThe camera zooms into the face striking portrait of a man, reimagined through the lens of old-school video-game graphics. The subject's face is rendered in a kaleidoscope of colors, with bold blues and reds set against a vibrant yellow backdrop. His dark hair is pulled back, framing his profile in a dramatic pose\n " + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Videos to use as conditioning + #[serde(skip_serializing_if = "Option::is_none")] + pub videos: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MulticonditioningVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/gallery/ltx-multicondition.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "A cute cat walking on a sidewalk" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-t2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoConditioningInput { + /// Frame number of the video from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, + /// URL of video to be extended + pub video_url: String, +} + +/// LTX Video-0.9.5 +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from a prompt. +pub fn extend(params: ExtendVideoInput) -> FalRequest { + FalRequest::new("fal-ai/ltx-video-v095/extend", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/image_to_video/mod.rs new file mode 100644 index 0000000000..c128c17d4c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/image_to_video/mod.rs @@ -0,0 +1,219 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "Woman walking on a street in Tokyo" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Video to be extended. + /// {"start_frame_num":24,"video_url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: VideoConditioningInput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-v095_extend.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageConditioningInput { + /// URL of image to use as conditioning + pub image_url: String, + /// Frame number of the image from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Image URL for Image-to-Video task + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "The astronaut gets up and walks away" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx_i2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiConditioningVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// URL of images to use as conditioning + /// [{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/NswO1P8sCLzrh1WefqQFK_9a6bdbfa54b944c9a770338159a113fd.jpg","start_frame_num":0},{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/YAPOGvmS2tM_Krdp7q6-d_267c97e017c34f679844a4477dfcec38.jpg","start_frame_num":120}] + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option>>, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "\n A vibrant, abstract composition featuring a person with outstretched arms, rendered in a kaleidoscope of colors against a deep, dark background. The figure is composed of intricate, swirling patterns reminiscent of a mosaic, with hues of orange, yellow, blue, and green that evoke the style of artists such as Wassily Kandinsky or Bridget Riley. \n\nThe camera zooms into the face striking portrait of a man, reimagined through the lens of old-school video-game graphics. The subject's face is rendered in a kaleidoscope of colors, with bold blues and reds set against a vibrant yellow backdrop. His dark hair is pulled back, framing his profile in a dramatic pose\n " + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Videos to use as conditioning + #[serde(skip_serializing_if = "Option::is_none")] + pub videos: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MulticonditioningVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/gallery/ltx-multicondition.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "A cute cat walking on a sidewalk" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-t2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoConditioningInput { + /// Frame number of the video from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, + /// URL of video to be extended + pub video_url: String, +} + +/// LTX Video-0.9.5 +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from a prompt. +pub fn image_to_video( + params: ImageToVideoInput, +) -> FalRequest { + FalRequest::new("fal-ai/ltx-video-v095/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/mod.rs new file mode 100644 index 0000000000..665ee104d9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/mod.rs @@ -0,0 +1,260 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" + ))) +)] +pub mod extend; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" + ))) +)] +pub mod multiconditioning; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "Woman walking on a street in Tokyo" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Video to be extended. + /// {"start_frame_num":24,"video_url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: VideoConditioningInput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-v095_extend.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageConditioningInput { + /// URL of image to use as conditioning + pub image_url: String, + /// Frame number of the image from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Image URL for Image-to-Video task + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "The astronaut gets up and walks away" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx_i2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiConditioningVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// URL of images to use as conditioning + /// [{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/NswO1P8sCLzrh1WefqQFK_9a6bdbfa54b944c9a770338159a113fd.jpg","start_frame_num":0},{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/YAPOGvmS2tM_Krdp7q6-d_267c97e017c34f679844a4477dfcec38.jpg","start_frame_num":120}] + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option>>, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "\n A vibrant, abstract composition featuring a person with outstretched arms, rendered in a kaleidoscope of colors against a deep, dark background. The figure is composed of intricate, swirling patterns reminiscent of a mosaic, with hues of orange, yellow, blue, and green that evoke the style of artists such as Wassily Kandinsky or Bridget Riley. \n\nThe camera zooms into the face striking portrait of a man, reimagined through the lens of old-school video-game graphics. The subject's face is rendered in a kaleidoscope of colors, with bold blues and reds set against a vibrant yellow backdrop. His dark hair is pulled back, framing his profile in a dramatic pose\n " + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Videos to use as conditioning + #[serde(skip_serializing_if = "Option::is_none")] + pub videos: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MulticonditioningVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/gallery/ltx-multicondition.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "A cute cat walking on a sidewalk" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-t2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoConditioningInput { + /// Frame number of the video from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, + /// URL of video to be extended + pub video_url: String, +} + +/// LTX Video-0.9.5 +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from a prompt. +pub fn ltx_video_v095(params: TextToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/ltx-video-v095", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/multiconditioning/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/multiconditioning/mod.rs new file mode 100644 index 0000000000..f747dff5b2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/ltx_video_v095/multiconditioning/mod.rs @@ -0,0 +1,219 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "Woman walking on a street in Tokyo" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Video to be extended. + /// {"start_frame_num":24,"video_url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: VideoConditioningInput, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ExtendVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-v095_extend.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageConditioningInput { + /// URL of image to use as conditioning + pub image_url: String, + /// Frame number of the image from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Image URL for Image-to-Video task + /// "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg" + pub image_url: String, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "The astronaut gets up and walks away" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx_i2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MultiConditioningVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// URL of images to use as conditioning + /// [{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/NswO1P8sCLzrh1WefqQFK_9a6bdbfa54b944c9a770338159a113fd.jpg","start_frame_num":0},{"image_url":"https://storage.googleapis.com/falserverless/model_tests/ltx/YAPOGvmS2tM_Krdp7q6-d_267c97e017c34f679844a4477dfcec38.jpg","start_frame_num":120}] + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option>>, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "\n A vibrant, abstract composition featuring a person with outstretched arms, rendered in a kaleidoscope of colors against a deep, dark background. The figure is composed of intricate, swirling patterns reminiscent of a mosaic, with hues of orange, yellow, blue, and green that evoke the style of artists such as Wassily Kandinsky or Bridget Riley. \n\nThe camera zooms into the face striking portrait of a man, reimagined through the lens of old-school video-game graphics. The subject's face is rendered in a kaleidoscope of colors, with bold blues and reds set against a vibrant yellow backdrop. His dark hair is pulled back, framing his profile in a dramatic pose\n " + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Videos to use as conditioning + #[serde(skip_serializing_if = "Option::is_none")] + pub videos: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MulticonditioningVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/gallery/ltx-multicondition.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to expand the prompt using the model's own capabilities. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// Negative prompt for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Text prompt to guide generation + /// "A cute cat walking on a sidewalk" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/example_outputs/ltx-t2v_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoConditioningInput { + /// Frame number of the video from which the conditioning starts. Must be a multiple of 8. + pub start_frame_num: i64, + /// URL of video to be extended + pub video_url: String, +} + +/// LTX Video-0.9.5 +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from a prompt. +pub fn multiconditioning( + params: MultiConditioningVideoInput, +) -> FalRequest { + FalRequest::new("fal-ai/ltx-video-v095/multiconditioning", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/image_to_video/mod.rs new file mode 100644 index 0000000000..ef4cd1d599 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/image_to_video/mod.rs @@ -0,0 +1,148 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/luma-dream-machine/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/mod.rs new file mode 100644 index 0000000000..a18a5e2dad --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/mod.rs @@ -0,0 +1,191 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod ray_2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod ray_2_flash; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn luma_dream_machine(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/luma-dream-machine", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/image_to_video/mod.rs new file mode 100644 index 0000000000..a7f44772b2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/image_to_video/mod.rs @@ -0,0 +1,156 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Luma's state of the art Ray2 model for image-to-video generation. +/// +/// Takes initial and/or final images and generates a video that starts from +/// and/or ends with those images. +pub fn image_to_video( + params: Ray2ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/luma-dream-machine/ray-2/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/mod.rs new file mode 100644 index 0000000000..17c6ff94ae --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2/mod.rs @@ -0,0 +1,169 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Luma's state of the art Ray2 model for text-to-video generation. +/// +/// Large-scale video generative model capable of creating realistic visuals with natural, coherent +/// motion. It has strong understanding of text instructions and can take image and video as input. +pub fn ray_2(params: Ray2TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/luma-dream-machine/ray-2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/image_to_video/mod.rs new file mode 100644 index 0000000000..d1f21f565f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/image_to_video/mod.rs @@ -0,0 +1,159 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Luma's state of the art Ray2 model for image-to-video generation. +/// +/// Takes initial and/or final images and generates a video that starts from +/// and/or ends with those images. +pub fn image_to_video( + params: Ray2ImageToVideoRequest, +) -> FalRequest { + FalRequest::new( + "fal-ai/luma-dream-machine/ray-2-flash/image-to-video", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/mod.rs new file mode 100644 index 0000000000..5b367fc5a8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_dream_machine/ray_2_flash/mod.rs @@ -0,0 +1,171 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/8c216fcbc4ed41cd8840bd48c1ec6dd6_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// An image to blend the end of the video with + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + pub image_url: String, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2I2VOutput { + /// URL of the generated video + /// {"url":"https://v3.fal.media/files/zebra/9aDde3Te2kuJYHdR0Kz8R_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Final image to end the video with. Can be used together with image_url. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_image_url: Option, + /// Initial image to start the video from. Can be used together with end_image_url. + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Ray2T2VOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/penguin/Om3xjcOwiSCJwrXs7DUi__output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Ray2TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video (9s costs 2x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, + /// The resolution of the generated video (720p costs 2x more, 1080p costs 4x more) + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VOutput { + /// The generated video + /// {"url":"https://v2.fal.media/files/807e842c734f4127a36de9262a2d292c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether the video should loop (end of video is blended with the beginning) + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "loop")] + pub r#loop: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Ray 2 Flash +/// +/// Category: text-to-video +/// Machine Type: A100 +/// +/// +/// Luma's state of the art Ray2 model for text-to-video generation. +/// +/// Large-scale video generative model capable of creating realistic visuals with natural, coherent +/// motion. It has strong understanding of text instructions and can take image and video as input. +pub fn ray_2_flash( + params: Ray2TextToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/luma-dream-machine/ray-2-flash", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/flash/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/flash/mod.rs new file mode 100644 index 0000000000..f79fdcce30 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/flash/mod.rs @@ -0,0 +1,63 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2IOutput { + /// The generated image + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Photon +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn flash(params: TextToImageRequest) -> FalRequest { + FalRequest::new("fal-ai/luma-photon/flash", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/mod.rs new file mode 100644 index 0000000000..ec2f135466 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/luma_photon/mod.rs @@ -0,0 +1,78 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-photon" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-photon" + ))) +)] +pub mod flash; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2IOutput { + /// The generated image + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Luma Photon +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn luma_photon(params: TextToImageRequest) -> FalRequest { + FalRequest::new("fal-ai/luma-photon", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/mod.rs new file mode 100644 index 0000000000..18044e0b28 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lumina-image" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lumina-image" + ))) +)] +pub mod v2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/v2/mod.rs new file mode 100644 index 0000000000..dd1e3c337b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/lumina_image/v2/mod.rs @@ -0,0 +1,156 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated images + /// [{"content_type":"image/jpeg","height":768,"url":"https://v3.fal.media/files/rabbit/pBwaEZysJhnstKWEHGpLc.png","width":1024}] + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// Whether to normalize the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_normalization: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A vibrant and artistic digital composition featuring colorful splashes of paint in the background, creating an energetic and dynamic effect. The text 'Lumina on Fal' is elegantly integrated into the scene, standing out with a modern, bold, and slightly futuristic font. The colors are bright and varied, including neon blues, purples, pinks, and oranges, blending seamlessly in a fluid, abstract style. The text appears slightly illuminated, complementing the vivid splashes around it." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The system prompt to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub system_prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Lumina Image 2 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn v2(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/lumina-image/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/mod.rs new file mode 100644 index 0000000000..db1d1e987e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/mod.rs @@ -0,0 +1,72 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mini-cpm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mini-cpm" + ))) +)] +pub mod video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiniCPMV26ImageInput { + /// List of image URLs to be used for the image description + /// ["https://llava-vl.github.io/static/images/monalisa.jpg"] + pub image_urls: Vec, + /// Prompt to be used for the image description + /// "Who is she? Who drew this?" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MiniCPMV26Output { + /// Response from the model + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiniCPMV26VideoInput { + /// Prompt to be used for the video description + /// "What is she doing? Describe it detailed way." + pub prompt: String, + /// URL of the video to be analyzed + /// "https://storage.googleapis.com/falserverless/model_tests/musepose/dance.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MiniCPM-V 2.6 +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn mini_cpm( + params: MiniCPMV26ImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/mini-cpm", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/video/mod.rs new file mode 100644 index 0000000000..58241737bd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mini_cpm/video/mod.rs @@ -0,0 +1,55 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiniCPMV26ImageInput { + /// List of image URLs to be used for the image description + /// ["https://llava-vl.github.io/static/images/monalisa.jpg"] + pub image_urls: Vec, + /// Prompt to be used for the image description + /// "Who is she? Who drew this?" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MiniCPMV26Output { + /// Response from the model + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiniCPMV26VideoInput { + /// Prompt to be used for the video description + /// "What is she doing? Describe it detailed way." + pub prompt: String, + /// URL of the video to be analyzed + /// "https://storage.googleapis.com/falserverless/model_tests/musepose/dance.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MiniCPM-V 2.6 +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn video(params: MiniCPMV26VideoInput) -> FalRequest { + FalRequest::new("fal-ai/mini-cpm/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/image_to_video/mod.rs new file mode 100644 index 0000000000..a30dd69b71 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/image_to_video/mod.rs @@ -0,0 +1,151 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/minimax/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/mod.rs new file mode 100644 index 0000000000..2c946ccd0a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/mod.rs @@ -0,0 +1,222 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod video_01; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod video_01_director; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod video_01_live; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod video_01_subject_reference; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +pub fn minimax(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/minimax", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/image_to_video/mod.rs new file mode 100644 index 0000000000..6deaa06fb7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/image_to_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo I2V-01 API: Native high-resolution, high-frame-rate video generation model, supports text-to-video and image-to-video +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/mod.rs new file mode 100644 index 0000000000..2d76f233c3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01/mod.rs @@ -0,0 +1,170 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo T2V-01 API: Native high-resolution, high-frame-rate video generation model, supports text-to-video and image-to-video +pub fn video_01(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/image_to_video/mod.rs new file mode 100644 index 0000000000..f0a88622c9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/image_to_video/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo I2V-01-Director API: Image-to-video generation with precise camera control for cinematic storytelling +pub fn image_to_video( + params: ImageToVideoDirectorRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01-director/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/mod.rs new file mode 100644 index 0000000000..148452c851 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_director/mod.rs @@ -0,0 +1,172 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo T2V-01-Director API: Text-to-video generation with precise camera control for cinematic storytelling +pub fn video_01_director( + params: TextToVideoDirectorRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01-director", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/image_to_video/mod.rs new file mode 100644 index 0000000000..37016eba94 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/image_to_video/mod.rs @@ -0,0 +1,162 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo I2V-01-Live image-to-video API: Transform Static Art into Dynamic Masterpieces +/// +/// Live is our latest addition to the I2V family, designed to revolutionize how 2D illustrations come to life. With +/// enhanced smoothness and vivid motion, this model lets your characters move, speak, and shine like never before. Optimized +/// for stability and subtle expression, Hailuo I2V-01-Live supports a wide range of artistic styles, empowering you to expand +/// your creative expression and bring your art to life with unparalleled fluidity and finesse. +pub fn image_to_video( + params: ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01-live/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/mod.rs new file mode 100644 index 0000000000..98bde3ac03 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_live/mod.rs @@ -0,0 +1,177 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo T2V-01-Live text-to-video API: Transform Static Art into Dynamic Masterpieces +/// +/// Live is our latest addition to the I2V family, designed to revolutionize how 2D illustrations come to life. With enhanced +/// smoothness and vivid motion, this model lets your characters move, speak, and shine like never before. Optimized for stability +/// and subtle expression, Hailuo I2V-01-Live supports a wide range of artistic styles, empowering you to expand your creative expression +/// and bring your art to life with unparalleled fluidity and finesse. +pub fn video_01_live( + params: TextToVideoLiveRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01-live", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_subject_reference/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_subject_reference/mod.rs new file mode 100644 index 0000000000..49bcb86514 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax/video_01_subject_reference/mod.rs @@ -0,0 +1,157 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VDirectorOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/minimax/i2v-01.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/bkT4T4uLOXr0jDsIMlNd5_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoDirectorRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in, Follow]A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse.[Pan left] The street opens into a small plaza where street vendors sell steaming food under colorful awnings." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SubjectReferenceOutput { + /// The generated video + /// {"url":"https://fal.media/files/rabbit/pONKqOnY7z6GlF6oDESvR_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SubjectReferenceRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, + /// URL of the subject reference image to use for consistent subject appearance + /// "https://fal.media/files/tiger/s2xnjhLpjM6L8ISxlDCAw.png" + pub subject_reference_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VDirectorOutput { + /// The generated video + /// {"url":"https://fal.media/files/panda/4Et1qL4cbedh-OACEw7OF_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct T2VLiveOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/EbJRdZfaJbNiJBUvPta3c_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoDirectorRequest { + /// Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]. For a more detailed guide, refer https://sixth-switch-2ac.notion.site/T2V-01-Director-Model-Tutorial-with-camera-movement-1886c20a98eb80f395b8e05291ad8645 + /// "[Push in]Close up of a tense woman looks to the left, startled by a sound, in a darkened kitchen, Pots and pans hang ominously, the window in the kitchen is open and the wind softly blows the pans and creates an ominous mood. [Shake]the woman’s shock turns to fear. Black-and-white film noir shot dimly lit, 1950s-style, with dramatic, high-contrast shadows. The overall atmosphere is reminiscent of Alfred Hitchcock’s suspenseful storytelling, evoking a looming sense of dread with stark chiaroscuro lighting and a slight film-grain texture." + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoLiveRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + pub prompt: String, + /// Whether to use the model's prompt optimizer + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/monkey/vNZqQV_WgC9MhoidClLyw_output.mp4"} + pub video: File, +} + +/// MiniMax (Hailuo AI) Video 01 Live +/// +/// Category: text-to-video +/// +/// +/// +/// Hailuo S2V-01 API: Text-to-video generation with subject reference image for consistent character appearance +pub fn video_01_subject_reference( + params: SubjectReferenceRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax/video-01-subject-reference", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_image/mod.rs new file mode 100644 index 0000000000..027822c717 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_image/mod.rs @@ -0,0 +1,76 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MiniMaxTextToImageOutput { + /// Generated images + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MiniMaxTextToImageRequest { + /// Aspect ratio of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Number of images to generate (1-9) + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Text prompt for image generation (max 1500 characters) + /// "Man dressed in white t shirt, full-body stand front view image, outdoor, Venice beach sign, full-body image, Los Angeles, Fashion photography of 90s, documentary, Film grain, photorealistic" + pub prompt: String, + /// Whether to enable automatic prompt optimization + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_optimizer: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MiniMax (Hailuo AI) Text to Image +/// +/// Category: text-to-image +/// +/// +/// +/// Generate images from text prompt using MiniMax API. +pub fn minimax_image( + params: MiniMaxTextToImageRequest, +) -> FalRequest { + FalRequest::new("fal-ai/minimax-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_music/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_music/mod.rs new file mode 100644 index 0000000000..5a35f68b1c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/minimax_music/mod.rs @@ -0,0 +1,88 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MusicOutput { + /// The generated music + /// {"url":"https://fal.media/files/elephant/N5UNLCwkC2y8v7a3LQLFE_output.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToMusicRequest { + /// Lyrics with optional formatting. You can use a newline to separate each line of lyrics. You can use two newlines to add a pause between lines. You can use double hash marks (##) at the beginning and end of the lyrics to add accompaniment. Maximum 600 characters. + /// "## Fast and Limitless \n In the heart of the code, where dreams collide, \n\nFAL's the name, taking tech for a ride. \nGenerative media, blazing the trail, \n\nFast inference power, we'll never fail.\n##" + pub prompt: String, + /// Reference song, should contain music and vocals. Must be a .wav or .mp3 file longer than 15 seconds. + /// "https://fal.media/files/lion/OOTBTSlxKMH_E8H6hoSlb.mpga" + pub reference_audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// MiniMax (Hailuo AI) Music +/// +/// Category: text-to-audio +/// +/// License Type: commercial +pub fn minimax_music(params: TextToMusicRequest) -> FalRequest { + FalRequest::new("fal-ai/minimax-music", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mix_dehaze_net/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mix_dehaze_net/mod.rs new file mode 100644 index 0000000000..171f727370 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mix_dehaze_net/mod.rs @@ -0,0 +1,77 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MixDehazeNetInput { + /// URL of image to be used for image enhancement + pub image_url: String, + /// Model to be used for dehazing + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MixDehazeNetOutput { + /// The generated image file info. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MixDehazer +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn mix_dehaze_net( + params: MixDehazeNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/mix-dehaze-net", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/mod.rs new file mode 100644 index 0000000000..1f9f965223 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/mod.rs @@ -0,0 +1,160 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mmaudio-v2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mmaudio-v2" + ))) +)] +pub mod text_to_audio; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The strength of Classifier Free Guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_strength: Option, + /// The duration of the audio to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether to mask away the clip. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_away_clip: Option, + /// The negative prompt to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of steps to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_steps: Option, + /// The prompt to generate the audio for. + /// "Indian holy music" + pub prompt: String, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioOutput { + /// The generated audio. + /// {"content_type":"application/octet-stream","file_name":"mmaudio_input.flac","file_size":1001342,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_output.flac"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The strength of Classifier Free Guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_strength: Option, + /// The duration of the audio to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether to mask away the clip. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_away_clip: Option, + /// The negative prompt to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of steps to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_steps: Option, + /// The prompt to generate the audio for. + /// "Indian holy music" + pub prompt: String, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the video to generate the audio for. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated video with the lip sync. + /// {"content_type":"application/octet-stream","file_name":"mmaudio_input.mp4","file_size":1001342,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// MMAudio V2 +/// +/// Category: video-to-video +/// Machine Type: A100 +pub fn mmaudio_v2(params: BaseInput) -> FalRequest { + FalRequest::new("fal-ai/mmaudio-v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/text_to_audio/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/text_to_audio/mod.rs new file mode 100644 index 0000000000..6cae57f8b3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mmaudio_v2/text_to_audio/mod.rs @@ -0,0 +1,145 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The strength of Classifier Free Guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_strength: Option, + /// The duration of the audio to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether to mask away the clip. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_away_clip: Option, + /// The negative prompt to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of steps to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_steps: Option, + /// The prompt to generate the audio for. + /// "Indian holy music" + pub prompt: String, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AudioOutput { + /// The generated audio. + /// {"content_type":"application/octet-stream","file_name":"mmaudio_input.flac","file_size":1001342,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_output.flac"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The strength of Classifier Free Guidance. + #[serde(skip_serializing_if = "Option::is_none")] + pub cfg_strength: Option, + /// The duration of the audio to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Whether to mask away the clip. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_away_clip: Option, + /// The negative prompt to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of steps to generate the audio for. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_steps: Option, + /// The prompt to generate the audio for. + /// "Indian holy music" + pub prompt: String, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the video to generate the audio for. + /// "https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_input.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// The generated video with the lip sync. + /// {"content_type":"application/octet-stream","file_name":"mmaudio_input.mp4","file_size":1001342,"url":"https://storage.googleapis.com/falserverless/model_tests/video_models/mmaudio_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// MMAudio V2 +/// +/// Category: video-to-video +/// Machine Type: A100 +pub fn text_to_audio(params: AudioInput) -> FalRequest { + FalRequest::new("fal-ai/mmaudio-v2/text-to-audio", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mochi_v1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mochi_v1/mod.rs new file mode 100644 index 0000000000..95fd42ed8b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mochi_v1/mod.rs @@ -0,0 +1,73 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MochiT2VInput { + /// Whether to enable prompt expansion. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_expansion: Option, + /// The negative prompt for the video. + /// "Blurry, shaky footage" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to generate a video from. + /// "A dog running in a field." + pub prompt: String, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MochiT2VOutput { + /// The generated video + /// {"url":"https://fal.media/files/zebra/GScPi-7ma3Fn8r1O1on4z_output_1729631871.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Mochi 1 +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn mochi_v1(params: MochiT2VInput) -> FalRequest { + FalRequest::new("fal-ai/mochi-v1", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/mod.rs new file mode 100644 index 0000000000..ac9e8f2874 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/mod.rs @@ -0,0 +1,2352 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_amt-interpolation" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_amt-interpolation" + ))) +)] +pub mod amt_interpolation; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-sparsectrl-lcm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-sparsectrl-lcm" + ))) +)] +pub mod animatediff_sparsectrl_lcm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-v2v" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_animatediff-v2v" + ))) +)] +pub mod animatediff_v2v; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_any-llm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_any-llm" + ))) +)] +pub mod any_llm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_aura-flow" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_aura-flow" + ))) +)] +pub mod aura_flow; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_aura-sr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_aura-sr" + ))) +)] +pub mod aura_sr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_auto-caption" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_auto-caption" + ))) +)] +pub mod auto_caption; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ben" + ))) +)] +pub mod ben; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_birefnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_birefnet" + ))) +)] +pub mod birefnet; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_bria" + ))) +)] +pub mod bria; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cat-vton" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cat-vton" + ))) +)] +pub mod cat_vton; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ccsr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ccsr" + ))) +)] +pub mod ccsr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_clarity-upscaler" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_clarity-upscaler" + ))) +)] +pub mod clarity_upscaler; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_codeformer" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_codeformer" + ))) +)] +pub mod codeformer; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogvideox-5b" + ))) +)] +pub mod cogvideox_5b; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogview4" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_cogview4" + ))) +)] +pub mod cogview4; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_controlnext" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_controlnext" + ))) +)] +pub mod controlnext; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_creative-upscaler" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_creative-upscaler" + ))) +)] +pub mod creative_upscaler; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_csm-1b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_csm-1b" + ))) +)] +pub mod csm_1b; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ddcolor" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ddcolor" + ))) +)] +pub mod ddcolor; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_diffrhythm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_diffrhythm" + ))) +)] +pub mod diffrhythm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_diffusion-edge" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_diffusion-edge" + ))) +)] +pub mod diffusion_edge; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_docres" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_docres" + ))) +)] +pub mod docres; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_drct-super-resolution" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_drct-super-resolution" + ))) +)] +pub mod drct_super_resolution; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dreamshaper" + ))) +)] +pub mod dreamshaper; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dubbing" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dubbing" + ))) +)] +pub mod dubbing; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dwpose" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_dwpose" + ))) +)] +pub mod dwpose; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_elevenlabs" + ))) +)] +pub mod elevenlabs; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_era-3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_era-3d" + ))) +)] +pub mod era_3d; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_esrgan" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_esrgan" + ))) +)] +pub mod esrgan; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_evf-sam" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_evf-sam" + ))) +)] +pub mod evf_sam; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_eye-correct" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_eye-correct" + ))) +)] +pub mod eye_correct; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_f5-tts" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_f5-tts" + ))) +)] +pub mod f5_tts; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_face-to-sticker" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_face-to-sticker" + ))) +)] +pub mod face_to_sticker; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-animatediff" + ))) +)] +pub mod fast_animatediff; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-fooocus-sdxl" + ))) +)] +pub mod fast_fooocus_sdxl; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lcm-diffusion" + ))) +)] +pub mod fast_lcm_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-lightning-sdxl" + ))) +)] +pub mod fast_lightning_sdxl; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl" + ))) +)] +pub mod fast_sdxl; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny" + ))) +)] +pub mod fast_sdxl_controlnet_canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd" + ))) +)] +pub mod fast_svd; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd-lcm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-svd-lcm" + ))) +)] +pub mod fast_svd_lcm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fast-turbo-diffusion" + ))) +)] +pub mod fast_turbo_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ffmpeg-api" + ))) +)] +pub mod ffmpeg_api; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_florence-2-large" + ))) +)] +pub mod florence_2_large; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flowedit" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flowedit" + ))) +)] +pub mod flowedit; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux" + ))) +)] +pub mod flux; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-canny" + ))) +)] +pub mod flux_control_lora_canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-depth" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-control-lora-depth" + ))) +)] +pub mod flux_control_lora_depth; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-differential-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-differential-diffusion" + ))) +)] +pub mod flux_differential_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-general" + ))) +)] +pub mod flux_general; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora" + ))) +)] +pub mod flux_lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-canny" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-canny" + ))) +)] +pub mod flux_lora_canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-depth" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-depth" + ))) +)] +pub mod flux_lora_depth; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-fast-training" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-fast-training" + ))) +)] +pub mod flux_lora_fast_training; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-fill" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-fill" + ))) +)] +pub mod flux_lora_fill; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-portrait-trainer" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-lora-portrait-trainer" + ))) +)] +pub mod flux_lora_portrait_trainer; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro" + ))) +)] +pub mod flux_pro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro-trainer" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pro-trainer" + ))) +)] +pub mod flux_pro_trainer; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pulid" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-pulid" + ))) +)] +pub mod flux_pulid; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-subject" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_flux-subject" + ))) +)] +pub mod flux_subject; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_fooocus" + ))) +)] +pub mod fooocus; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_gemini-flash-edit" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_gemini-flash-edit" + ))) +)] +pub mod gemini_flash_edit; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_got-ocr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_got-ocr" + ))) +)] +pub mod got_ocr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan3d" + ))) +)] +pub mod hunyuan3d; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video" + ))) +)] +pub mod hunyuan_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-image-to-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-image-to-video" + ))) +)] +pub mod hunyuan_video_image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-img2vid-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-img2vid-lora" + ))) +)] +pub mod hunyuan_video_img2vid_lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora" + ))) +)] +pub mod hunyuan_video_lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora-training" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hunyuan-video-lora-training" + ))) +)] +pub mod hunyuan_video_lora_training; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper3d" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper3d" + ))) +)] +pub mod hyper3d; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_hyper-sdxl" + ))) +)] +pub mod hyper_sdxl; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_iclight-v2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_iclight-v2" + ))) +)] +pub mod iclight_v2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ideogram" + ))) +)] +pub mod ideogram; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_illusion-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_illusion-diffusion" + ))) +)] +pub mod illusion_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_image-preprocessors" + ))) +)] +pub mod image_preprocessors; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imagen3" + ))) +)] +pub mod imagen3; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_imageutils" + ))) +)] +pub mod imageutils; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_inpaint" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_inpaint" + ))) +)] +pub mod inpaint; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_invisible-watermark" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_invisible-watermark" + ))) +)] +pub mod invisible_watermark; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ip-adapter-face-id" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ip-adapter-face-id" + ))) +)] +pub mod ip_adapter_face_id; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_janus" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_janus" + ))) +)] +pub mod janus; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling" + ))) +)] +pub mod kling; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kling-video" + ))) +)] +pub mod kling_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kokoro" + ))) +)] +pub mod kokoro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kolors" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_kolors" + ))) +)] +pub mod kolors; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_latentsync" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_latentsync" + ))) +)] +pub mod latentsync; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_layer-diffusion" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_layer-diffusion" + ))) +)] +pub mod layer_diffusion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lcm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lcm" + ))) +)] +pub mod lcm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lcm-sd15-i2i" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lcm-sd15-i2i" + ))) +)] +pub mod lcm_sd15_i2i; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_leffa" + ))) +)] +pub mod leffa; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lightning-models" + ))) +)] +pub mod lightning_models; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_live-portrait" + ))) +)] +pub mod live_portrait; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_llava-next" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_llava-next" + ))) +)] +pub mod llava_next; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_llavav15-13b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_llavav15-13b" + ))) +)] +pub mod llavav15_13b; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lora" + ))) +)] +pub mod lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video" + ))) +)] +pub mod ltx_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_ltx-video-v095" + ))) +)] +pub mod ltx_video_v095; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-dream-machine" + ))) +)] +pub mod luma_dream_machine; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-photon" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_luma-photon" + ))) +)] +pub mod luma_photon; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lumina-image" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_lumina-image" + ))) +)] +pub mod lumina_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mini-cpm" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mini-cpm" + ))) +)] +pub mod mini_cpm; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax" + ))) +)] +pub mod minimax; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax-image" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax-image" + ))) +)] +pub mod minimax_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax-music" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_minimax-music" + ))) +)] +pub mod minimax_music; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mix-dehaze-net" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mix-dehaze-net" + ))) +)] +pub mod mix_dehaze_net; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mmaudio-v2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mmaudio-v2" + ))) +)] +pub mod mmaudio_v2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mochi-v1" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_mochi-v1" + ))) +)] +pub mod mochi_v1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream" + ))) +)] +pub mod moondream; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" + ))) +)] +pub mod moondream_next; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_musetalk" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_musetalk" + ))) +)] +pub mod musetalk; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" + ))) +)] +pub mod nafnet; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_omni-zero" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_omni-zero" + ))) +)] +pub mod omni_zero; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_omnigen-v1" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_omnigen-v1" + ))) +)] +pub mod omnigen_v1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_photomaker" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_photomaker" + ))) +)] +pub mod photomaker; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod pika; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixart-sigma" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixart-sigma" + ))) +)] +pub mod pixart_sigma; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod pixverse; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" + ))) +)] +pub mod playai; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" + ))) +)] +pub mod playground_v25; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_post-processing" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_post-processing" + ))) +)] +pub mod post_processing; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pulid" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pulid" + ))) +)] +pub mod pulid; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" + ))) +)] +pub mod realistic_vision; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-20b" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-20b" + ))) +)] +pub mod recraft_20b; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-clarity-upscale" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-clarity-upscale" + ))) +)] +pub mod recraft_clarity_upscale; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-creative-upscale" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-creative-upscale" + ))) +)] +pub mod recraft_creative_upscale; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-v3" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-v3" + ))) +)] +pub mod recraft_v3; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_retoucher" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_retoucher" + ))) +)] +pub mod retoucher; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod sa2va; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sadtalker" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sadtalker" + ))) +)] +pub mod sadtalker; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" + ))) +)] +pub mod sam2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sana" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sana" + ))) +)] +pub mod sana; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" + ))) +)] +pub mod sd15_depth_controlnet; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" + ))) +)] +pub mod sdxl_controlnet_union; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_skyreels-i2v" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_skyreels-i2v" + ))) +)] +pub mod skyreels_i2v; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-audio" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-audio" + ))) +)] +pub mod stable_audio; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-cascade" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-cascade" + ))) +)] +pub mod stable_cascade; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" + ))) +)] +pub mod stable_diffusion_v15; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod stable_diffusion_v35_large; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-medium" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-medium" + ))) +)] +pub mod stable_diffusion_v35_medium; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium" + ))) +)] +pub mod stable_diffusion_v3_medium; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-video" + ))) +)] +pub mod stable_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stepfun-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stepfun-video" + ))) +)] +pub mod stepfun_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_swin2sr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_swin2sr" + ))) +)] +pub mod swin2sr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_switti" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_switti" + ))) +)] +pub mod switti; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync" + ))) +)] +pub mod sync_lipsync; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_t2v-turbo" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_t2v-turbo" + ))) +)] +pub mod t2v_turbo; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_thera" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_thera" + ))) +)] +pub mod thera; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod topaz; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_transpixar" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_transpixar" + ))) +)] +pub mod transpixar; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_trellis" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_trellis" + ))) +)] +pub mod trellis; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_triposr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_triposr" + ))) +)] +pub mod triposr; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_veo2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_veo2" + ))) +)] +pub mod veo2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_video-prompt-generator" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_video-prompt-generator" + ))) +)] +pub mod video_prompt_generator; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_video-upscaler" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_video-upscaler" + ))) +)] +pub mod video_upscaler; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" + ))) +)] +pub mod vidu; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" + ))) +)] +pub mod wan; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-effects" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-effects" + ))) +)] +pub mod wan_effects; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-i2v" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-i2v" + ))) +)] +pub mod wan_i2v; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-i2v-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-i2v-lora" + ))) +)] +pub mod wan_i2v_lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" + ))) +)] +pub mod wan_pro; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-t2v" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-t2v" + ))) +)] +pub mod wan_t2v; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-trainer" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-trainer" + ))) +)] +pub mod wan_trainer; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_whisper" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_whisper" + ))) +)] +pub mod whisper; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wizper" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wizper" + ))) +)] +pub mod wizper; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod workflowutils; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_yue" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_yue" + ))) +)] +pub mod yue; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_zonos" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_zonos" + ))) +)] +pub mod zonos; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/batched/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/batched/mod.rs new file mode 100644 index 0000000000..e2d8f65127 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/batched/mod.rs @@ -0,0 +1,84 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchedMoondreamInput { + /// List of input prompts and image URLs + /// [{"image_url":"https://github.com/vikhyat/moondream/raw/main/assets/demo-1.jpg","prompt":"What is the girl doing?"}] + pub inputs: Vec, + /// Maximum number of new tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Model ID to use for inference + #[serde(skip_serializing_if = "Option::is_none")] + pub model_id: Option, + /// Repetition penalty for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub repetition_penalty: Option, + /// Temperature for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub temperature: Option, + /// Top P for sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub top_p: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BatchedMoondreamOutput { + /// Filenames of the images processed + #[serde(skip_serializing_if = "Option::is_none")] + pub filenames: Option>>, + /// List of generated outputs + pub outputs: Vec, + /// Whether the output is partial + #[serde(skip_serializing_if = "Option::is_none")] + pub partial: Option, + /// Timings for different parts of the process + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MoondreamInputParam { + /// URL of the image to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Prompt to be used for the image + /// "Do you know who drew this painting?" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Moondream +/// +/// Category: vision +/// Machine Type: A6000 +pub fn batched( + params: BatchedMoondreamInput, +) -> FalRequest { + FalRequest::new("fal-ai/moondream/batched", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/mod.rs new file mode 100644 index 0000000000..44c5f64812 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream" + ))) +)] +pub mod batched; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/batch/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/batch/mod.rs new file mode 100644 index 0000000000..4160687b77 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/batch/mod.rs @@ -0,0 +1,144 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize)] +pub struct BatchMoonDreamOutput { + /// URL to the generated captions JSON file containing filename-caption pairs. + pub captions_file: File, + /// List of generated captions + pub outputs: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchQueryInput { + /// List of image URLs to be processed (maximum 32 images) + pub images_data_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Single prompt to apply to all images + /// "Describe this image in detail." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectionInput { + /// Text description of what to detect + /// "Person" + pub detection_prompt: String, + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Type of detection to perform + pub task_type: String, + /// Whether to use ensemble for gaze detection + #[serde(skip_serializing_if = "Option::is_none")] + pub use_ensemble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectionOutput { + /// Output image with detection visualization + pub image: Image, + /// Detection results as text + pub text_output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MoonDreamOutput { + /// Response from the model + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct QueryInput { + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Prompt for query task + /// "Describe this image in detail." + pub prompt: String, + /// Type of task to perform + #[serde(skip_serializing_if = "Option::is_none")] + pub task_type: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MoonDreamNext +/// +/// Category: vision +/// +/// License Type: commercial +pub fn batch(params: BatchQueryInput) -> FalRequest { + FalRequest::new("fal-ai/moondream-next/batch", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/detection/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/detection/mod.rs new file mode 100644 index 0000000000..6f1355763f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/detection/mod.rs @@ -0,0 +1,144 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchMoonDreamOutput { + /// URL to the generated captions JSON file containing filename-caption pairs. + pub captions_file: File, + /// List of generated captions + pub outputs: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchQueryInput { + /// List of image URLs to be processed (maximum 32 images) + pub images_data_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Single prompt to apply to all images + /// "Describe this image in detail." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectionInput { + /// Text description of what to detect + /// "Person" + pub detection_prompt: String, + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Type of detection to perform + pub task_type: String, + /// Whether to use ensemble for gaze detection + #[serde(skip_serializing_if = "Option::is_none")] + pub use_ensemble: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct DetectionOutput { + /// Output image with detection visualization + pub image: Image, + /// Detection results as text + pub text_output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MoonDreamOutput { + /// Response from the model + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct QueryInput { + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Prompt for query task + /// "Describe this image in detail." + pub prompt: String, + /// Type of task to perform + #[serde(skip_serializing_if = "Option::is_none")] + pub task_type: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MoonDreamNext +/// +/// Category: vision +/// +/// License Type: commercial +pub fn detection(params: DetectionInput) -> FalRequest { + FalRequest::new("fal-ai/moondream-next/detection", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/mod.rs new file mode 100644 index 0000000000..a9ff26fa5b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/moondream_next/mod.rs @@ -0,0 +1,173 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" + ))) +)] +pub mod batch; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_moondream-next" + ))) +)] +pub mod detection; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchMoonDreamOutput { + /// URL to the generated captions JSON file containing filename-caption pairs. + pub captions_file: File, + /// List of generated captions + pub outputs: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BatchQueryInput { + /// List of image URLs to be processed (maximum 32 images) + pub images_data_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Single prompt to apply to all images + /// "Describe this image in detail." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectionInput { + /// Text description of what to detect + /// "Person" + pub detection_prompt: String, + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Type of detection to perform + pub task_type: String, + /// Whether to use ensemble for gaze detection + #[serde(skip_serializing_if = "Option::is_none")] + pub use_ensemble: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectionOutput { + /// Output image with detection visualization + pub image: Image, + /// Detection results as text + pub text_output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MoonDreamOutput { + /// Response from the model + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct QueryInput { + /// Image URL to be processed + /// "https://llava-vl.github.io/static/images/monalisa.jpg" + pub image_url: String, + /// Maximum number of tokens to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub max_tokens: Option, + /// Prompt for query task + /// "Describe this image in detail." + pub prompt: String, + /// Type of task to perform + #[serde(skip_serializing_if = "Option::is_none")] + pub task_type: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MoonDreamNext +/// +/// Category: vision +/// +/// License Type: commercial +pub fn moondream_next(params: QueryInput) -> FalRequest { + FalRequest::new("fal-ai/moondream-next", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/musetalk/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/musetalk/mod.rs new file mode 100644 index 0000000000..5a960aa51c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/musetalk/mod.rs @@ -0,0 +1,65 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MuseTalkInput { + /// URL of the audio + /// "https://raw.githubusercontent.com/TMElyralab/MuseTalk/main/data/audio/sun.wav" + pub audio_url: String, + /// URL of the source video + /// "https://raw.githubusercontent.com/TMElyralab/MuseTalk/main/data/video/sun.mp4" + pub source_video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct MuseTalkOutput { + /// The generated video file. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// MuseTalk +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn musetalk(params: MuseTalkInput) -> FalRequest { + FalRequest::new("fal-ai/musetalk", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/deblur/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/deblur/mod.rs new file mode 100644 index 0000000000..cd972e094f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/deblur/mod.rs @@ -0,0 +1,91 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/nafnet/blurry.png" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetInputDenoise { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/nafnet/noisy.png" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct NafnetOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/nafnet/2cbfd460e25344a69fa8077808fb484f.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetOutputDenoise { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/nafnet/7c97e55956324a7cbee00ac9652a931b.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// NAFNet-deblur +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn deblur(params: NafnetInput) -> FalRequest { + FalRequest::new("fal-ai/nafnet/deblur", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/denoise/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/denoise/mod.rs new file mode 100644 index 0000000000..dfa26c807c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/denoise/mod.rs @@ -0,0 +1,91 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetInput { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/nafnet/blurry.png" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetInputDenoise { + /// URL of image to be used for relighting + /// "https://storage.googleapis.com/falserverless/nafnet/noisy.png" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NafnetOutput { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/nafnet/2cbfd460e25344a69fa8077808fb484f.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct NafnetOutputDenoise { + /// The generated image file info. + /// {"content_type":"image/png","file_name":"36d3ca4791a647678b2ff01a35c87f5a.png","file_size":423052,"height":512,"url":"https://storage.googleapis.com/falserverless/nafnet/7c97e55956324a7cbee00ac9652a931b.png","width":512} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// NAFNet-deblur +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn denoise(params: NafnetInputDenoise) -> FalRequest { + FalRequest::new("fal-ai/nafnet/denoise", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/mod.rs new file mode 100644 index 0000000000..91f90de3e2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/nafnet/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" + ))) +)] +pub mod deblur; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_nafnet" + ))) +)] +pub mod denoise; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/omni_zero/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/omni_zero/mod.rs new file mode 100644 index 0000000000..8c1e100fdb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/omni_zero/mod.rs @@ -0,0 +1,123 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct OmniZeroInput { + /// Composition image url. + /// "https://storage.googleapis.com/falserverless/model_tests/omni_zero/structure.jpg" + pub composition_image_url: String, + /// Composition strength. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub composition_strength: Option, + /// Depth strength. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_strength: Option, + /// Face strength. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub face_strength: Option, + /// Guidance scale. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Identity image url. + /// "https://storage.googleapis.com/falserverless/model_tests/omni_zero/identity.jpg" + pub identity_image_url: String, + /// Identity strength. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub identity_strength: Option, + /// Image strength. + /// 0.75 + #[serde(skip_serializing_if = "Option::is_none")] + pub image_strength: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/omni_zero/structure.jpg" + pub image_url: String, + /// Negative prompt to guide the image generation. + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub number_of_images: Option, + /// Prompt to guide the image generation. + /// "A woman" + pub prompt: String, + /// Seed. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Style image url. + /// "https://storage.googleapis.com/falserverless/model_tests/omni_zero/style.jpg" + pub style_image_url: String, + /// Style strength. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub style_strength: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OmniZeroOutput { + /// The generated image. + /// {"content_type":"image/png","height":1024,"url":"https://storage.googleapis.com/falserverless/model_tests/omni_zero/result.png","width":1024} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Omni Zero +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn omni_zero(params: OmniZeroInput) -> FalRequest { + FalRequest::new("fal-ai/omni-zero", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/omnigen_v1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/omnigen_v1/mod.rs new file mode 100644 index 0000000000..146000e05b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/omnigen_v1/mod.rs @@ -0,0 +1,131 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The Image Guidance scale is a measure of how close you want + /// the model to stick to your input image when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub img_guidance_scale: Option, + /// URL of images to use while generating the image, Use <|image_1|> for the first image and so on. + + #[serde(skip_serializing_if = "Option::is_none")] + pub input_image_urls: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Neon words \"Omni Gen\" are flashing in the prosperous future city, the sense of science and technology, quality details, hyper realistic, high definition, 8K, photo, best quality, high quality." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// OmniGen v1 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn omnigen_v1(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/omnigen-v1", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/photomaker/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/photomaker/mod.rs new file mode 100644 index 0000000000..a164302df0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/photomaker/mod.rs @@ -0,0 +1,106 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoMakerInput { + /// The base pipeline to use for generating the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub base_pipeline: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image archive containing the images you want to use. + /// "https://storage.googleapis.com/falserverless/model_tests/photomaker/elon.zip" + pub image_archive_url: String, + /// How much noise to add to the latent image. O for no noise, 1 for maximum noise. + #[serde(skip_serializing_if = "Option::is_none")] + pub initial_image_strength: Option, + /// Optional initial image for img2img + #[serde(skip_serializing_if = "Option::is_none")] + pub initial_image_url: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate in one request. Note that the higher the batch size, + /// the longer it will take to generate the images. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Increasing the amount of steps tells Stable Diffusion that it should take more steps + /// to generate your final result which can increase the amount of detail in your image. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "instagram photo, portrait photo of a man img, colorful, perfect face, natural skin, hard shadows, film grain" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + /// 42 + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub style_strength: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PhotoMakerOutput { + pub images: Vec, + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// PhotoMaker +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn photomaker(params: PhotoMakerInput) -> FalRequest { + FalRequest::new("fal-ai/photomaker", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/mod.rs new file mode 100644 index 0000000000..958af4d900 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/mod.rs @@ -0,0 +1,56 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod v1_5; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod v2; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod v2_1; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod v2_2; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/mod.rs new file mode 100644 index 0000000000..4074aed492 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod pikaffects; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/pikaffects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/pikaffects/mod.rs new file mode 100644 index 0000000000..3d74ebb59a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v1_5/pikaffects/mod.rs @@ -0,0 +1,295 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Pikaffects Generation. +/// +/// Generate a video with a specific Pikaffect. Supported Pikaffects include: +/// Cake-ify, Crumble, Crush, Decapitate, Deflate, Dissolve, Explode, Eye-pop, +/// Inflate, Levitate, Melt, Peel, Poke, Squish, Ta-da, Tear +pub fn pikaffects(params: PikaffectsRequest) -> FalRequest { + FalRequest::new("fal-ai/pika/v1.5/pikaffects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/mod.rs new file mode 100644 index 0000000000..1e930af006 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod pikadditions; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod pikaswaps; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod turbo; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikadditions/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikadditions/mod.rs new file mode 100644 index 0000000000..458a4bfa3b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikadditions/mod.rs @@ -0,0 +1,296 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Pikadditions Generation. +/// +/// Add any object or image into your video. Upload a video and specify what +/// you'd like to add to create a seamlessly integrated result. +pub fn pikadditions( + params: PikadditionsRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2/pikadditions", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikaswaps/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikaswaps/mod.rs new file mode 100644 index 0000000000..47c7861f49 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/pikaswaps/mod.rs @@ -0,0 +1,294 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Pikaswaps Generation. +/// +/// Swap out any object or region of your video with a new image or object. +/// Define areas to replace with a text description. +pub fn pikaswaps(params: PikaswapsRequest) -> FalRequest { + FalRequest::new("fal-ai/pika/v2/pikaswaps", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/collection_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/collection_to_video/mod.rs new file mode 100644 index 0000000000..a30532d1d8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/collection_to_video/mod.rs @@ -0,0 +1,295 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Turbo Collection-to-Video Generation. +/// +/// Generates a video from multiple images and text prompt using the Pika Turbo model. +pub fn collection_to_video( + params: CollectionToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2/turbo/collection-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/image_to_video/mod.rs new file mode 100644 index 0000000000..5a6ab15c0a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/image_to_video/mod.rs @@ -0,0 +1,293 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Turbo Image-to-Video Generation. +/// +/// Generates a video from an initial image and text prompt using the Pika Turbo model. +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pika/v2/turbo/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/mod.rs new file mode 100644 index 0000000000..7d09b435d7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod collection_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/text_to_video/mod.rs new file mode 100644 index 0000000000..9149ae3827 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2/turbo/text_to_video/mod.rs @@ -0,0 +1,293 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika Turbo Text-to-Video Generation. +/// +/// Generates a video from text description using the Pika Turbo model. +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pika/v2/turbo/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/collection_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/collection_to_video/mod.rs new file mode 100644 index 0000000000..fb752ba09f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/collection_to_video/mod.rs @@ -0,0 +1,295 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.1 Collection-to-Video Generation. +/// +/// Generates a video from multiple images and text prompt using the Pika 2.1 model. +pub fn collection_to_video( + params: CollectionToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.1/collection-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/image_to_video/mod.rs new file mode 100644 index 0000000000..c16ce28ac2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/image_to_video/mod.rs @@ -0,0 +1,295 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.1 Image-to-Video Generation. +/// +/// Generates a video from an initial image and text prompt using the Pika 2.1 model. +pub fn image_to_video( + params: ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.1/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/mod.rs new file mode 100644 index 0000000000..7d09b435d7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod collection_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/text_to_video/mod.rs new file mode 100644 index 0000000000..d95cc94d71 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_1/text_to_video/mod.rs @@ -0,0 +1,295 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.1 Text-to-Video Generation. +/// +/// Generates a video from text description using the Pika 2.1 model. +pub fn text_to_video( + params: TextToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.1/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/image_to_video/mod.rs new file mode 100644 index 0000000000..4af909e7e1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/image_to_video/mod.rs @@ -0,0 +1,296 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.2 Image-to-Video Generation. +/// +/// Transforms a static image into a dynamic video using the Pika 2.2 model. +/// This is Pika's highest quality model with support for resolution and duration options. +pub fn image_to_video( + params: Pika22ImageToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.2/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/mod.rs new file mode 100644 index 0000000000..368cece20b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod pikascenes; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pika" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/pikascenes/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/pikascenes/mod.rs new file mode 100644 index 0000000000..6bc3d9568b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/pikascenes/mod.rs @@ -0,0 +1,296 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.2 Pikascenes Generation. +/// +/// Combines multiple images to create a video that incorporates all objects. +/// This is Pika's highest quality model with support for resolution and duration options. +pub fn pikascenes( + params: CollectionToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.2/pikascenes", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/text_to_video/mod.rs new file mode 100644 index 0000000000..95290eaf04 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pika/v2_2/text_to_video/mod.rs @@ -0,0 +1,296 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CollectionToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// List of images to use for video generation + /// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}] + pub images: Vec, + /// Mode for integrating multiple images + #[serde(skip_serializing_if = "Option::is_none")] + pub ingredients_mode: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22ImageToVideoRequest { + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png" + pub image_url: String, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Pika22TextToVideoOutput { + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pika22TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaImage { + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsOutput { + /// The generated video with added objects/images + /// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikadditionsRequest { + /// URL of the image to add + /// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing what to add + /// "A parrot in the shoulder of the person picking up cookies" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsOutput { + /// The generated video with applied effect + /// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaffectsRequest { + /// URL of the input image + /// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg" + pub image_url: String, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The Pikaffect to apply + /// "Crush" + pub pikaffect: String, + /// Text prompt to guide the effect + /// "A duck getting crushed" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsOutput { + /// The generated video with swapped regions + /// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PikaswapsRequest { + /// URL of the image to swap with + /// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg" + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Plaintext description of the object/region to modify + /// "the cookie jars" + #[serde(skip_serializing_if = "Option::is_none")] + pub modify_region: Option, + /// Negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Text prompt describing the modification + /// "Replace the background with a jelly jar" + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the input video + /// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// A negative prompt to guide the model + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The seed for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"} + pub video: File, +} + +/// Pika Effects (v1.5) +/// +/// Category: image-to-video +/// +/// +/// +/// Pika 2.2 Text-to-Video Generation. +/// +/// Generates a video from text description using the Pika 2.2 model. +/// This is Pika's highest quality model with support for resolution and duration options. +pub fn text_to_video( + params: Pika22TextToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/pika/v2.2/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixart_sigma/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixart_sigma/mod.rs new file mode 100644 index 0000000000..1092766544 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixart_sigma/mod.rs @@ -0,0 +1,161 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PixArtSigmaInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Photorealistic closeup video of two pirate ships battling each other as they sail inside a cup of coffee." + /// "an astronaut sitting in a diner, eating fries, cinematic, analog film" + /// "Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, light pollution, cinematic atmosphere, art nouveau style, illustration art artwork by SenseiJaye, intricate detail." + /// "stars, water, brilliantly, gorgeous large scale scene, a little girl, in the style of dreamy realism, light gold and amber, blue and pink, brilliantly illuminated in the background." + /// "professional portrait photo of an anthropomorphic cat wearing fancy gentleman hat and jacket walking in autumn forest." + /// "beautiful lady, freckles, big smile, blue eyes, short ginger hair, dark makeup, wearing a floral blue vest top, soft light, dark grey background" + /// "Spectacular Tiny World in the Transparent Jar On the Table, interior of the Great Hall, Elaborate, Carved Architecture, Anatomy, Symmetrical, Geometric and Parameteric Details, Precision Flat line Details, Pattern, Dark fantasy, Dark errie mood and ineffably mysterious mood, Technical design, Intricate Ultra Detail, Ornate Detail, Stylized and Futuristic and Biomorphic Details, Architectural Concept, Low contrast Details, Cinematic Lighting, 8k, by moebius, Fullshot, Epic, Fullshot, Octane render, Unreal ,Photorealistic, Hyperrealism" + /// "anthropomorphic profile of the white snow owl Crystal priestess , art deco painting, pretty and expressive eyes, ornate costume, mythical, ethereal, intricate, elaborate, hyperrealism, hyper detailed, 3D, 8K, Ultra Realistic, high octane, ultra resolution, amazing detail, perfection, In frame, photorealistic, cinematic lighting, visual clarity, shading , Lumen Reflections, Super-Resolution, gigapixel, color grading, retouch, enhanced, PBR, Blender, V-ray, Procreate, zBrush, Unreal Engine 5, cinematic, volumetric, dramatic, neon lighting, wide angle lens ,no digital painting blur" + /// "The parametric hotel lobby is a sleek and modern space with plenty of natural light. The lobby is spacious and open with a variety of seating options. The front desk is a sleek white counter with a parametric design. The walls are a light blue color with parametric patterns. The floor is a light wood color with a parametric design. There are plenty of plants and flowers throughout the space. The overall effect is a calm and relaxing space. occlusion, moody, sunset, concept art, octane rendering, 8k, highly detailed, concept art, highly detailed, beautiful scenery, cinematic, beautiful light, hyperreal, octane render, hdr, long exposure, 8K, realistic, fog, moody, fire and explosions, smoke, 50mm f2.8" + pub prompt: String, + /// The scheduler to use for the model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduler: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style to apply to the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PixArtSigmaOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + /// The timings of the different steps of the generation process. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// PixArt-Σ +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn pixart_sigma(params: PixArtSigmaInput) -> FalRequest { + FalRequest::new("fal-ai/pixart-sigma", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/mod.rs new file mode 100644 index 0000000000..6e8f6f7066 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod v3_5; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/fast/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/fast/mod.rs new file mode 100644 index 0000000000..0091675d1c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/fast/mod.rs @@ -0,0 +1,163 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":4060052,"url":"https://fal.media/files/tiger/8V9H8RLyFiWjmJDOxGbcG_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":2995630,"url":"https://fal.media/files/zebra/11UahivZ3XZ1tRlcEcgPq_output.mp4"} + pub video: File, +} + +/// PixVerse v3.5 +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn fast(params: FastImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pixverse/v3.5/image-to-video/fast", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/mod.rs new file mode 100644 index 0000000000..f85f9d90a6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/image_to_video/mod.rs @@ -0,0 +1,178 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod fast; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct I2VOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":4060052,"url":"https://fal.media/files/tiger/8V9H8RLyFiWjmJDOxGbcG_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":2995630,"url":"https://fal.media/files/zebra/11UahivZ3XZ1tRlcEcgPq_output.mp4"} + pub video: File, +} + +/// PixVerse v3.5 +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pixverse/v3.5/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/mod.rs new file mode 100644 index 0000000000..4d00646977 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/fast/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/fast/mod.rs new file mode 100644 index 0000000000..3effa640d3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/fast/mod.rs @@ -0,0 +1,163 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":4060052,"url":"https://fal.media/files/tiger/8V9H8RLyFiWjmJDOxGbcG_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":2995630,"url":"https://fal.media/files/zebra/11UahivZ3XZ1tRlcEcgPq_output.mp4"} + pub video: File, +} + +/// PixVerse v3.5 +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn fast(params: FastTextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pixverse/v3.5/text-to-video/fast", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/mod.rs new file mode 100644 index 0000000000..27c761e2ad --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pixverse/v3_5/text_to_video/mod.rs @@ -0,0 +1,178 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_pixverse" + ))) +)] +pub mod fast; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FastTextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct I2VOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":4060052,"url":"https://fal.media/files/tiger/8V9H8RLyFiWjmJDOxGbcG_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the image to use as the first frame + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoRequest { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds. 8s videos cost double. 1080p videos are limited to 5 seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Negative prompt to be used for the generation + /// "blurry, low quality, low resolution, pixelated, noisy, grainy, out of focus, poorly lit, poorly exposed, poorly composed, poorly framed, poorly cropped, poorly color corrected, poorly color graded" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + pub prompt: String, + /// The resolution of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"content_type":"video/mp4","file_name":"output.mp4","file_size":2995630,"url":"https://fal.media/files/zebra/11UahivZ3XZ1tRlcEcgPq_output.mp4"} + pub video: File, +} + +/// PixVerse v3.5 +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn text_to_video(params: TextToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/pixverse/v3.5/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/create_voice/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/create_voice/mod.rs new file mode 100644 index 0000000000..a5ad58b6f4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/create_voice/mod.rs @@ -0,0 +1,292 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioFile { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The duration of the audio file in seconds. + pub duration: f64, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The URL of the audio file. + /// "https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateVoiceInput { + /// Voice name (required, max 255 characters). + /// "my voice" + pub name: String, + /// A list of audio URLs used for cloning (must be between 1 and 5 URLs). + /// [{"audio_url":"https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3"}] + pub samples: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct CreateVoiceOutput { + /// The S3 URI of the cloned voice. + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMTTSInput { + /// S3 URI of the autoregressive (AR) model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub ar: Option, + /// The dialogue text with turn prefixes to distinguish speakers. + /// "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n" + pub input: String, + /// S3 URI of the AR LoRA model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub lora: Option, + /// The format of the response. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, + /// An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// S3 URI of the vocoder model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub vocoder: Option, + /// A list of voice definitions for each speaker in the dialogue. Must be between 1 and 2 voices. + #[serde(skip_serializing_if = "Option::is_none")] + pub voices: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMTTSOutput { + /// The generated audio file. + /// {"content_type":"audio/mpeg","duration":24.3,"file_name":"33dd5f07-f834-4080-aaac-4a253ce1660b.mp3","file_size":584109,"url":"https://fal-api-audio-uploads.s3.amazonaws.com/33dd5f07-f834-4080-aaac-4a253ce1660b.mp3"} + pub audio: AudioFile, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMVoiceInput { + /// A prefix to identify the speaker in multi-turn dialogues. + #[serde(skip_serializing_if = "Option::is_none")] + pub turn_prefix: Option, + /// The unique ID of a PlayHT or Cloned Voice, or a name from the available presets. + /// "Jennifer (English (US)/American)" + /// "Dexter (English (US)/American)" + /// "Ava (English (AU)/Australian)" + /// "Tilly (English (AU)/Australian)" + /// "Charlotte (Advertising) (English (CA)/Canadian)" + /// "Charlotte (Meditation) (English (CA)/Canadian)" + /// "Cecil (English (GB)/British)" + /// "Sterling (English (GB)/British)" + /// "Cillian (English (IE)/Irish)" + /// "Madison (English (IE)/Irish)" + /// "Ada (English (ZA)/South african)" + /// "Furio (English (IT)/Italian)" + /// "Alessandro (English (IT)/Italian)" + /// "Carmen (English (MX)/Mexican)" + /// "Sumita (English (IN)/Indian)" + /// "Navya (English (IN)/Indian)" + /// "Baptiste (English (FR)/French)" + /// "Lumi (English (FI)/Finnish)" + /// "Ronel Conversational (Afrikaans/South african)" + /// "Ronel Narrative (Afrikaans/South african)" + /// "Abdo Conversational (Arabic/Arabic)" + /// "Abdo Narrative (Arabic/Arabic)" + /// "Mousmi Conversational (Bengali/Bengali)" + /// "Mousmi Narrative (Bengali/Bengali)" + /// "Caroline Conversational (Portuguese (BR)/Brazilian)" + /// "Caroline Narrative (Portuguese (BR)/Brazilian)" + /// "Ange Conversational (French/French)" + /// "Ange Narrative (French/French)" + /// "Anke Conversational (German/German)" + /// "Anke Narrative (German/German)" + /// "Bora Conversational (Greek/Greek)" + /// "Bora Narrative (Greek/Greek)" + /// "Anuj Conversational (Hindi/Indian)" + /// "Anuj Narrative (Hindi/Indian)" + /// "Alessandro Conversational (Italian/Italian)" + /// "Alessandro Narrative (Italian/Italian)" + /// "Kiriko Conversational (Japanese/Japanese)" + /// "Kiriko Narrative (Japanese/Japanese)" + /// "Dohee Conversational (Korean/Korean)" + /// "Dohee Narrative (Korean/Korean)" + /// "Ignatius Conversational (Malay/Malay)" + /// "Ignatius Narrative (Malay/Malay)" + /// "Adam Conversational (Polish/Polish)" + /// "Adam Narrative (Polish/Polish)" + /// "Andrei Conversational (Russian/Russian)" + /// "Andrei Narrative (Russian/Russian)" + /// "Aleksa Conversational (Serbian/Serbian)" + /// "Aleksa Narrative (Serbian/Serbian)" + /// "Carmen Conversational (Spanish/Spanish)" + /// "Patricia Conversational (Spanish/Spanish)" + /// "Aiken Conversational (Tagalog/Filipino)" + /// "Aiken Narrative (Tagalog/Filipino)" + /// "Katbundit Conversational (Thai/Thai)" + /// "Katbundit Narrative (Thai/Thai)" + /// "Ali Conversational (Turkish/Turkish)" + /// "Ali Narrative (Turkish/Turkish)" + /// "Sahil Conversational (Urdu/Pakistani)" + /// "Sahil Narrative (Urdu/Pakistani)" + /// "Mary Conversational (Hebrew/Israeli)" + /// "Mary Narrative (Hebrew/Israeli)" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TrainingInput { + /// The name of the training job (required, max 255 characters). + /// "my voice" + pub name: String, + /// A list of audio URLs used for training (must be between 1 and 5 URLs). + /// [{"audio_url":"https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3"}] + pub training_data: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V3TTSInput { + /// The text to be converted to speech. + /// "The quick brown fox jumped over the lazy dog." + pub input: String, + /// The format of the response. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, + /// An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The unique ID of a PlayHT or Cloned Voice, or a name from the available presets. + /// "Jennifer (English (US)/American)" + /// "Dexter (English (US)/American)" + /// "Ava (English (AU)/Australian)" + /// "Tilly (English (AU)/Australian)" + /// "Charlotte (Advertising) (English (CA)/Canadian)" + /// "Charlotte (Meditation) (English (CA)/Canadian)" + /// "Cecil (English (GB)/British)" + /// "Sterling (English (GB)/British)" + /// "Cillian (English (IE)/Irish)" + /// "Madison (English (IE)/Irish)" + /// "Ada (English (ZA)/South african)" + /// "Furio (English (IT)/Italian)" + /// "Alessandro (English (IT)/Italian)" + /// "Carmen (English (MX)/Mexican)" + /// "Sumita (English (IN)/Indian)" + /// "Navya (English (IN)/Indian)" + /// "Baptiste (English (FR)/French)" + /// "Lumi (English (FI)/Finnish)" + /// "Ronel Conversational (Afrikaans/South african)" + /// "Ronel Narrative (Afrikaans/South african)" + /// "Abdo Conversational (Arabic/Arabic)" + /// "Abdo Narrative (Arabic/Arabic)" + /// "Mousmi Conversational (Bengali/Bengali)" + /// "Mousmi Narrative (Bengali/Bengali)" + /// "Caroline Conversational (Portuguese (BR)/Brazilian)" + /// "Caroline Narrative (Portuguese (BR)/Brazilian)" + /// "Ange Conversational (French/French)" + /// "Ange Narrative (French/French)" + /// "Anke Conversational (German/German)" + /// "Anke Narrative (German/German)" + /// "Bora Conversational (Greek/Greek)" + /// "Bora Narrative (Greek/Greek)" + /// "Anuj Conversational (Hindi/Indian)" + /// "Anuj Narrative (Hindi/Indian)" + /// "Alessandro Conversational (Italian/Italian)" + /// "Alessandro Narrative (Italian/Italian)" + /// "Kiriko Conversational (Japanese/Japanese)" + /// "Kiriko Narrative (Japanese/Japanese)" + /// "Dohee Conversational (Korean/Korean)" + /// "Dohee Narrative (Korean/Korean)" + /// "Ignatius Conversational (Malay/Malay)" + /// "Ignatius Narrative (Malay/Malay)" + /// "Adam Conversational (Polish/Polish)" + /// "Adam Narrative (Polish/Polish)" + /// "Andrei Conversational (Russian/Russian)" + /// "Andrei Narrative (Russian/Russian)" + /// "Aleksa Conversational (Serbian/Serbian)" + /// "Aleksa Narrative (Serbian/Serbian)" + /// "Carmen Conversational (Spanish/Spanish)" + /// "Patricia Conversational (Spanish/Spanish)" + /// "Aiken Conversational (Tagalog/Filipino)" + /// "Aiken Narrative (Tagalog/Filipino)" + /// "Katbundit Conversational (Thai/Thai)" + /// "Katbundit Narrative (Thai/Thai)" + /// "Ali Conversational (Turkish/Turkish)" + /// "Ali Narrative (Turkish/Turkish)" + /// "Sahil Conversational (Urdu/Pakistani)" + /// "Sahil Narrative (Urdu/Pakistani)" + /// "Mary Conversational (Hebrew/Israeli)" + /// "Mary Narrative (Hebrew/Israeli)" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V3TTSOutput { + /// The generated audio file. + /// {"content_type":"audio/mpeg","duration":2.3486666666666665,"file_name":"166db034-7421-4767-adad-ab7c36a99b75.mp3","file_size":57069,"url":"https://fal-api-audio-uploads.s3.amazonaws.com/166db034-7421-4767-adad-ab7c36a99b75.mp3"} + pub audio: AudioFile, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// PlayAI Text-to-Speech v3 +/// +/// Category: text-to-speech +pub fn create_voice(params: CreateVoiceInput) -> FalRequest { + FalRequest::new("fal-ai/playai/create-voice", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/mod.rs new file mode 100644 index 0000000000..3e75f62935 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" + ))) +)] +pub mod create_voice; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" + ))) +)] +pub mod train; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/dialog/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/dialog/mod.rs new file mode 100644 index 0000000000..04b1077c5e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/dialog/mod.rs @@ -0,0 +1,292 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioFile { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The duration of the audio file in seconds. + pub duration: f64, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AudioInput { + /// The URL of the audio file. + /// "https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3" + pub audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateVoiceInput { + /// Voice name (required, max 255 characters). + /// "my voice" + pub name: String, + /// A list of audio URLs used for cloning (must be between 1 and 5 URLs). + /// [{"audio_url":"https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3"}] + pub samples: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateVoiceOutput { + /// The S3 URI of the cloned voice. + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMTTSInput { + /// S3 URI of the autoregressive (AR) model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub ar: Option, + /// The dialogue text with turn prefixes to distinguish speakers. + /// "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n" + pub input: String, + /// S3 URI of the AR LoRA model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub lora: Option, + /// The format of the response. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, + /// An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// S3 URI of the vocoder model. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub vocoder: Option, + /// A list of voice definitions for each speaker in the dialogue. Must be between 1 and 2 voices. + #[serde(skip_serializing_if = "Option::is_none")] + pub voices: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMTTSOutput { + /// The generated audio file. + /// {"content_type":"audio/mpeg","duration":24.3,"file_name":"33dd5f07-f834-4080-aaac-4a253ce1660b.mp3","file_size":584109,"url":"https://fal-api-audio-uploads.s3.amazonaws.com/33dd5f07-f834-4080-aaac-4a253ce1660b.mp3"} + pub audio: AudioFile, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LDMVoiceInput { + /// A prefix to identify the speaker in multi-turn dialogues. + #[serde(skip_serializing_if = "Option::is_none")] + pub turn_prefix: Option, + /// The unique ID of a PlayHT or Cloned Voice, or a name from the available presets. + /// "Jennifer (English (US)/American)" + /// "Dexter (English (US)/American)" + /// "Ava (English (AU)/Australian)" + /// "Tilly (English (AU)/Australian)" + /// "Charlotte (Advertising) (English (CA)/Canadian)" + /// "Charlotte (Meditation) (English (CA)/Canadian)" + /// "Cecil (English (GB)/British)" + /// "Sterling (English (GB)/British)" + /// "Cillian (English (IE)/Irish)" + /// "Madison (English (IE)/Irish)" + /// "Ada (English (ZA)/South african)" + /// "Furio (English (IT)/Italian)" + /// "Alessandro (English (IT)/Italian)" + /// "Carmen (English (MX)/Mexican)" + /// "Sumita (English (IN)/Indian)" + /// "Navya (English (IN)/Indian)" + /// "Baptiste (English (FR)/French)" + /// "Lumi (English (FI)/Finnish)" + /// "Ronel Conversational (Afrikaans/South african)" + /// "Ronel Narrative (Afrikaans/South african)" + /// "Abdo Conversational (Arabic/Arabic)" + /// "Abdo Narrative (Arabic/Arabic)" + /// "Mousmi Conversational (Bengali/Bengali)" + /// "Mousmi Narrative (Bengali/Bengali)" + /// "Caroline Conversational (Portuguese (BR)/Brazilian)" + /// "Caroline Narrative (Portuguese (BR)/Brazilian)" + /// "Ange Conversational (French/French)" + /// "Ange Narrative (French/French)" + /// "Anke Conversational (German/German)" + /// "Anke Narrative (German/German)" + /// "Bora Conversational (Greek/Greek)" + /// "Bora Narrative (Greek/Greek)" + /// "Anuj Conversational (Hindi/Indian)" + /// "Anuj Narrative (Hindi/Indian)" + /// "Alessandro Conversational (Italian/Italian)" + /// "Alessandro Narrative (Italian/Italian)" + /// "Kiriko Conversational (Japanese/Japanese)" + /// "Kiriko Narrative (Japanese/Japanese)" + /// "Dohee Conversational (Korean/Korean)" + /// "Dohee Narrative (Korean/Korean)" + /// "Ignatius Conversational (Malay/Malay)" + /// "Ignatius Narrative (Malay/Malay)" + /// "Adam Conversational (Polish/Polish)" + /// "Adam Narrative (Polish/Polish)" + /// "Andrei Conversational (Russian/Russian)" + /// "Andrei Narrative (Russian/Russian)" + /// "Aleksa Conversational (Serbian/Serbian)" + /// "Aleksa Narrative (Serbian/Serbian)" + /// "Carmen Conversational (Spanish/Spanish)" + /// "Patricia Conversational (Spanish/Spanish)" + /// "Aiken Conversational (Tagalog/Filipino)" + /// "Aiken Narrative (Tagalog/Filipino)" + /// "Katbundit Conversational (Thai/Thai)" + /// "Katbundit Narrative (Thai/Thai)" + /// "Ali Conversational (Turkish/Turkish)" + /// "Ali Narrative (Turkish/Turkish)" + /// "Sahil Conversational (Urdu/Pakistani)" + /// "Sahil Narrative (Urdu/Pakistani)" + /// "Mary Conversational (Hebrew/Israeli)" + /// "Mary Narrative (Hebrew/Israeli)" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TrainingInput { + /// The name of the training job (required, max 255 characters). + /// "my voice" + pub name: String, + /// A list of audio URLs used for training (must be between 1 and 5 URLs). + /// [{"audio_url":"https://storage.googleapis.com/falserverless/model_tests/f5-tts/en_1_ref.mp3"}] + pub training_data: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V3TTSInput { + /// The text to be converted to speech. + /// "The quick brown fox jumped over the lazy dog." + pub input: String, + /// The format of the response. + #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, + /// An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The unique ID of a PlayHT or Cloned Voice, or a name from the available presets. + /// "Jennifer (English (US)/American)" + /// "Dexter (English (US)/American)" + /// "Ava (English (AU)/Australian)" + /// "Tilly (English (AU)/Australian)" + /// "Charlotte (Advertising) (English (CA)/Canadian)" + /// "Charlotte (Meditation) (English (CA)/Canadian)" + /// "Cecil (English (GB)/British)" + /// "Sterling (English (GB)/British)" + /// "Cillian (English (IE)/Irish)" + /// "Madison (English (IE)/Irish)" + /// "Ada (English (ZA)/South african)" + /// "Furio (English (IT)/Italian)" + /// "Alessandro (English (IT)/Italian)" + /// "Carmen (English (MX)/Mexican)" + /// "Sumita (English (IN)/Indian)" + /// "Navya (English (IN)/Indian)" + /// "Baptiste (English (FR)/French)" + /// "Lumi (English (FI)/Finnish)" + /// "Ronel Conversational (Afrikaans/South african)" + /// "Ronel Narrative (Afrikaans/South african)" + /// "Abdo Conversational (Arabic/Arabic)" + /// "Abdo Narrative (Arabic/Arabic)" + /// "Mousmi Conversational (Bengali/Bengali)" + /// "Mousmi Narrative (Bengali/Bengali)" + /// "Caroline Conversational (Portuguese (BR)/Brazilian)" + /// "Caroline Narrative (Portuguese (BR)/Brazilian)" + /// "Ange Conversational (French/French)" + /// "Ange Narrative (French/French)" + /// "Anke Conversational (German/German)" + /// "Anke Narrative (German/German)" + /// "Bora Conversational (Greek/Greek)" + /// "Bora Narrative (Greek/Greek)" + /// "Anuj Conversational (Hindi/Indian)" + /// "Anuj Narrative (Hindi/Indian)" + /// "Alessandro Conversational (Italian/Italian)" + /// "Alessandro Narrative (Italian/Italian)" + /// "Kiriko Conversational (Japanese/Japanese)" + /// "Kiriko Narrative (Japanese/Japanese)" + /// "Dohee Conversational (Korean/Korean)" + /// "Dohee Narrative (Korean/Korean)" + /// "Ignatius Conversational (Malay/Malay)" + /// "Ignatius Narrative (Malay/Malay)" + /// "Adam Conversational (Polish/Polish)" + /// "Adam Narrative (Polish/Polish)" + /// "Andrei Conversational (Russian/Russian)" + /// "Andrei Narrative (Russian/Russian)" + /// "Aleksa Conversational (Serbian/Serbian)" + /// "Aleksa Narrative (Serbian/Serbian)" + /// "Carmen Conversational (Spanish/Spanish)" + /// "Patricia Conversational (Spanish/Spanish)" + /// "Aiken Conversational (Tagalog/Filipino)" + /// "Aiken Narrative (Tagalog/Filipino)" + /// "Katbundit Conversational (Thai/Thai)" + /// "Katbundit Narrative (Thai/Thai)" + /// "Ali Conversational (Turkish/Turkish)" + /// "Ali Narrative (Turkish/Turkish)" + /// "Sahil Conversational (Urdu/Pakistani)" + /// "Sahil Narrative (Urdu/Pakistani)" + /// "Mary Conversational (Hebrew/Israeli)" + /// "Mary Narrative (Hebrew/Israeli)" + pub voice: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct V3TTSOutput { + /// The generated audio file. + /// {"content_type":"audio/mpeg","duration":2.3486666666666665,"file_name":"166db034-7421-4767-adad-ab7c36a99b75.mp3","file_size":57069,"url":"https://fal-api-audio-uploads.s3.amazonaws.com/166db034-7421-4767-adad-ab7c36a99b75.mp3"} + pub audio: AudioFile, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// PlayAI Text-to-Speech v3 +/// +/// Category: text-to-speech +pub fn dialog(params: TrainingInput) -> FalRequest { + FalRequest::new("fal-ai/playai/train/dialog", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/mod.rs new file mode 100644 index 0000000000..ac8d414d64 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playai/train/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playai" + ))) +)] +pub mod dialog; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/image_to_image/mod.rs new file mode 100644 index 0000000000..39565632e0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/image_to_image/mod.rs @@ -0,0 +1,275 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingPlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Masterpiece (wide angle shot) , Easterbunny crafting an incantation, (creating a little colorful magic egg in a nest:1.6), standing on an old carved table in a colorful factory laboratory. fantastic view" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Playground v2.5 +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: ImageToImagePlaygroundv25Input, +) -> FalRequest { + FalRequest::new("fal-ai/playground-v25/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/inpainting/mod.rs new file mode 100644 index 0000000000..acc5ff691d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/inpainting/mod.rs @@ -0,0 +1,275 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingPlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Masterpiece (wide angle shot) , Easterbunny crafting an incantation, (creating a little colorful magic egg in a nest:1.6), standing on an old carved table in a colorful factory laboratory. fantastic view" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Playground v2.5 +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting( + params: InpaintingPlaygroundv25Input, +) -> FalRequest { + FalRequest::new("fal-ai/playground-v25/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/mod.rs new file mode 100644 index 0000000000..4a9a2d3e20 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/playground_v25/mod.rs @@ -0,0 +1,304 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_playground-v25" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingPlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImagePlaygroundv25Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The rescale factor for the CFG. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_rescale: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Masterpiece (wide angle shot) , Easterbunny crafting an incantation, (creating a little colorful magic egg in a nest:1.6), standing on an old carved table in a colorful factory laboratory. fantastic view" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Playground v2.5 +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn playground_v25( + params: TextToImagePlaygroundv25Input, +) -> FalRequest { + FalRequest::new("fal-ai/playground-v25", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/post_processing/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/post_processing/mod.rs new file mode 100644 index 0000000000..8ac2885946 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/post_processing/mod.rs @@ -0,0 +1,230 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageProcessingInput { + /// Blue channel shift direction + #[serde(skip_serializing_if = "Option::is_none")] + pub blue_direction: Option, + /// Blue channel shift amount + #[serde(skip_serializing_if = "Option::is_none")] + pub blue_shift: Option, + /// Blur radius + #[serde(skip_serializing_if = "Option::is_none")] + pub blur_radius: Option, + /// Sigma for Gaussian blur + #[serde(skip_serializing_if = "Option::is_none")] + pub blur_sigma: Option, + /// Type of blur to apply + #[serde(skip_serializing_if = "Option::is_none")] + pub blur_type: Option, + /// Brightness adjustment + #[serde(skip_serializing_if = "Option::is_none")] + pub brightness: Option, + /// CAS sharpening amount + #[serde(skip_serializing_if = "Option::is_none")] + pub cas_amount: Option, + /// Contrast adjustment + #[serde(skip_serializing_if = "Option::is_none")] + pub contrast: Option, + /// Desaturation factor + #[serde(skip_serializing_if = "Option::is_none")] + pub desaturate_factor: Option, + /// Desaturation method + #[serde(skip_serializing_if = "Option::is_none")] + pub desaturate_method: Option, + /// Dissolve blend factor + #[serde(skip_serializing_if = "Option::is_none")] + pub dissolve_factor: Option, + /// URL of second image for dissolve + #[serde(skip_serializing_if = "Option::is_none")] + pub dissolve_image_url: Option, + /// Dodge and burn intensity + #[serde(skip_serializing_if = "Option::is_none")] + pub dodge_burn_intensity: Option, + /// Dodge and burn mode + #[serde(skip_serializing_if = "Option::is_none")] + pub dodge_burn_mode: Option, + /// Enable blur effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_blur: Option, + /// Enable chromatic aberration + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_chromatic: Option, + /// Enable color correction + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_color_correction: Option, + /// Enable desaturation effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_desaturate: Option, + /// Enable dissolve effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_dissolve: Option, + /// Enable dodge and burn effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_dodge_burn: Option, + /// Enable glow effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_glow: Option, + /// Enable film grain effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_grain: Option, + /// Enable parabolize effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_parabolize: Option, + /// Enable sharpen effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_sharpen: Option, + /// Enable solarize effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_solarize: Option, + /// Enable color tint effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_tint: Option, + /// Enable vignette effect + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_vignette: Option, + /// Gamma adjustment + #[serde(skip_serializing_if = "Option::is_none")] + pub gamma: Option, + /// Glow intensity + #[serde(skip_serializing_if = "Option::is_none")] + pub glow_intensity: Option, + /// Glow blur radius + #[serde(skip_serializing_if = "Option::is_none")] + pub glow_radius: Option, + /// Film grain intensity (when enabled) + #[serde(skip_serializing_if = "Option::is_none")] + pub grain_intensity: Option, + /// Film grain scale (when enabled) + #[serde(skip_serializing_if = "Option::is_none")] + pub grain_scale: Option, + /// Style of film grain to apply + #[serde(skip_serializing_if = "Option::is_none")] + pub grain_style: Option, + /// Green channel shift direction + #[serde(skip_serializing_if = "Option::is_none")] + pub green_direction: Option, + /// Green channel shift amount + #[serde(skip_serializing_if = "Option::is_none")] + pub green_shift: Option, + /// URL of image to process + /// "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg" + pub image_url: String, + /// Noise radius for smart sharpen + #[serde(skip_serializing_if = "Option::is_none")] + pub noise_radius: Option, + /// Parabolize coefficient + #[serde(skip_serializing_if = "Option::is_none")] + pub parabolize_coeff: Option, + /// Edge preservation factor + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_edges: Option, + /// Red channel shift direction + #[serde(skip_serializing_if = "Option::is_none")] + pub red_direction: Option, + /// Red channel shift amount + #[serde(skip_serializing_if = "Option::is_none")] + pub red_shift: Option, + /// Saturation adjustment + #[serde(skip_serializing_if = "Option::is_none")] + pub saturation: Option, + /// Sharpen strength (for basic mode) + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpen_alpha: Option, + /// Type of sharpening to apply + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpen_mode: Option, + /// Sharpen radius (for basic mode) + #[serde(skip_serializing_if = "Option::is_none")] + pub sharpen_radius: Option, + /// Smart sharpen blend ratio + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_sharpen_ratio: Option, + /// Smart sharpen strength + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_sharpen_strength: Option, + /// Solarize threshold + #[serde(skip_serializing_if = "Option::is_none")] + pub solarize_threshold: Option, + /// Color temperature adjustment + #[serde(skip_serializing_if = "Option::is_none")] + pub temperature: Option, + /// Tint color mode + #[serde(skip_serializing_if = "Option::is_none")] + pub tint_mode: Option, + /// Tint strength + #[serde(skip_serializing_if = "Option::is_none")] + pub tint_strength: Option, + /// Vertex X position + #[serde(skip_serializing_if = "Option::is_none")] + pub vertex_x: Option, + /// Vertex Y position + #[serde(skip_serializing_if = "Option::is_none")] + pub vertex_y: Option, + /// Vignette strength (when enabled) + #[serde(skip_serializing_if = "Option::is_none")] + pub vignette_strength: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ProcessedOutput { + /// The processed images + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Post Processing +/// +/// Category: image-to-image +pub fn post_processing( + params: ImageProcessingInput, +) -> FalRequest { + FalRequest::new("fal-ai/post-processing", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/pulid/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/pulid/mod.rs new file mode 100644 index 0000000000..2f8c8b6d44 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/pulid/mod.rs @@ -0,0 +1,137 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputModel { + /// Guidance scale + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// if you want to mix two ID image, please turn this on, otherwise, turn this off + #[serde(skip_serializing_if = "Option::is_none")] + pub id_mix: Option, + /// ID scale + #[serde(skip_serializing_if = "Option::is_none")] + pub id_scale: Option, + /// Size of the generated image + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// Mode of generation + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Negative prompt to generate the face from + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of images to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// Number of steps to take + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Prompt to generate the face from + /// "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play" + pub prompt: String, + /// List of reference faces, ideally 4 images. + /// [{"image_url":"https://fal.media/files/monkey/CxgWoVIo1BklMncNKpqWB.webp"},{"image_url":"https://fal.media/files/kangaroo/ffgpzpvs4j9BE_B5ol6a1.webp"},{"image_url":"https://fal.media/files/rabbit/glcNYPonhV1_klj_xWhPy.webp"},{"image_url":"https://fal.media/files/rabbit/E4gKiWRvPH4efX24GfhHE.jpeg"}] + pub reference_images: Vec, + /// Random seed for reproducibility + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputModel { + /// List of generated images + pub images: Vec, + /// Random seed used for reproducibility + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceFace { + /// URL of the reference face image + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// PuLID +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn pulid(params: InputModel) -> FalRequest { + FalRequest::new("fal-ai/pulid", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/image_to_image/mod.rs new file mode 100644 index 0000000000..faea1d2f3b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/image_to_image/mod.rs @@ -0,0 +1,294 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Realistic Vision +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn image_to_image( + params: RealisticVisionImageToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/realistic-vision/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/inpainting/mod.rs new file mode 100644 index 0000000000..47ded54a4d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/inpainting/mod.rs @@ -0,0 +1,294 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Realistic Vision +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn inpainting( + params: RealisticVisionInpaintingInput, +) -> FalRequest { + FalRequest::new("fal-ai/realistic-vision/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/mod.rs new file mode 100644 index 0000000000..6b285d4a85 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/realistic_vision/mod.rs @@ -0,0 +1,323 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_realistic-vision" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionImageToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionInpaintingInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RealisticVisionTextToImageInput { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The Realistic Vision model to use. + /// "SG161222/Realistic_Vision_V6.0_B1_noVAE" + /// "SG161222/RealVisXL_V4.0" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_name: Option, + /// The negative prompt to use. Use it to address details that you don't want in the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "A hyperdetailed photograph of a Cat dressed as a mafia boss holding a fish walking down a Japanese fish market with an angry face, 8k resolution, best quality, beautiful photograph, dynamic lighting," + pub prompt: String, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Realistic Vision +/// +/// Category: text-to-image +/// Machine Type: A100 +pub fn realistic_vision( + params: RealisticVisionTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/realistic-vision", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_20b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_20b/mod.rs new file mode 100644 index 0000000000..a7c0e1c4e6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_20b/mod.rs @@ -0,0 +1,117 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBColor { + /// Blue color value + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green color value + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red color value + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Recraft20BTextToImageInput { + /// An array of preferable colors + #[serde(skip_serializing_if = "Option::is_none")] + pub colors: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + pub prompt: String, + /// The style of the generated images. Vector images cost 2X as much. + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The ID of the custom style reference (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub style_id: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Recraft20BTextToImageOutput { + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Recraft 20b +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// State of the art Recraft 20B model by recraft.ai, use it as an API directly through fal. +pub fn recraft_20b( + params: Recraft20BTextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/recraft-20b", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_clarity_upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_clarity_upscale/mod.rs new file mode 100644 index 0000000000..80995a1459 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_clarity_upscale/mod.rs @@ -0,0 +1,79 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The URL of the image to be upscaled. Must be in PNG format. + /// "https://storage.googleapis.com/falserverless/model_tests/recraft/recraft-upscaler-1.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + /// The upscaled image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Recraft Clarity Upscale +/// +/// Category: image-to-image +/// +/// +/// +/// Enhances a given raster image using 'clarity upscale' tool, +/// increasing image resolution, making the image sharper and cleaner. +pub fn recraft_clarity_upscale(params: UpscaleInput) -> FalRequest { + FalRequest::new("fal-ai/recraft-clarity-upscale", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_creative_upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_creative_upscale/mod.rs new file mode 100644 index 0000000000..f6f882f444 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_creative_upscale/mod.rs @@ -0,0 +1,79 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpscaleInput { + /// The URL of the image to be upscaled. Must be in PNG format. + /// "https://storage.googleapis.com/falserverless/model_tests/recraft/recraft-upscaler-1.jpeg" + pub image_url: String, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct UpscaleOutput { + /// The upscaled image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Recraft Creative Upscale +/// +/// Category: image-to-image +/// +/// +/// +/// Enhances a given raster image using 'clarity upscale' tool, +/// increasing image resolution, making the image sharper and cleaner. +pub fn recraft_creative_upscale(params: UpscaleInput) -> FalRequest { + FalRequest::new("fal-ai/recraft-creative-upscale", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/create_style/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/create_style/mod.rs new file mode 100644 index 0000000000..28f10be39a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/create_style/mod.rs @@ -0,0 +1,130 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBColor { + /// Blue color value + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green color value + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red color value + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StyleReferenceInput { + /// The base style of the generated images, this topic is covered above. + #[serde(skip_serializing_if = "Option::is_none")] + pub base_style: Option, + /// URL to zip archive with images, use PNG format. Maximum 5 images are allowed. + pub images_data_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct StyleReferenceOutput { + /// The ID of the created style, this ID can be used to reference the style in the future. + pub style_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// An array of preferable colors + #[serde(skip_serializing_if = "Option::is_none")] + pub colors: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + pub prompt: String, + /// The style of the generated images. Vector images cost 2X as much. + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The ID of the custom style reference (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub style_id: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageOutput { + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Recraft V3 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn create_style( + params: StyleReferenceInput, +) -> FalRequest { + FalRequest::new("fal-ai/recraft-v3/create-style", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/mod.rs new file mode 100644 index 0000000000..b5411260e2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/recraft_v3/mod.rs @@ -0,0 +1,145 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-v3" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_recraft-v3" + ))) +)] +pub mod create_style; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBColor { + /// Blue color value + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green color value + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red color value + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StyleReferenceInput { + /// The base style of the generated images, this topic is covered above. + #[serde(skip_serializing_if = "Option::is_none")] + pub base_style: Option, + /// URL to zip archive with images, use PNG format. Maximum 5 images are allowed. + pub images_data_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StyleReferenceOutput { + /// The ID of the created style, this ID can be used to reference the style in the future. + pub style_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// An array of preferable colors + #[serde(skip_serializing_if = "Option::is_none")] + pub colors: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + pub prompt: String, + /// The style of the generated images. Vector images cost 2X as much. + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, + /// The ID of the custom style reference (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub style_id: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextToImageOutput { + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// Recraft V3 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// State of the art Recraft V3 model by recraft.ai, use it as an API directly through fal. +pub fn recraft_v3(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/recraft-v3", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/retoucher/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/retoucher/mod.rs new file mode 100644 index 0000000000..e9feb50c66 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/retoucher/mod.rs @@ -0,0 +1,73 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RetoucherInput { + /// The URL of the image to be retouched. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/Dalton-Meereskosmetik-Magazin-Pickelguide-Model_1.resized.jpg" + pub image_url: String, + /// Seed for reproducibility. Different seeds will make slightly different results. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct RetoucherOutput { + /// The generated image file info. + /// {"url":"https://storage.googleapis.com/falserverless/model_tests/retoucher/retoucher_example_output.png"} + pub image: Image, + /// The seed used for the generation. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Face Retoucher +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn retoucher(params: RetoucherInput) -> FalRequest { + FalRequest::new("fal-ai/retoucher", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/image/mod.rs new file mode 100644 index 0000000000..3542a93199 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/image/mod.rs @@ -0,0 +1,32 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct ImageChatOutput { + /// Dictionary of label: mask image/// Dictionary of label: mask image/// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + +pub masks: Vec, +/// Generated output/// Generated output/// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + +pub output: String + } + + + /// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial + pub fn image(params: ImageInput) -> FalRequest { + FalRequest::new( + "fal-ai/sa2va/8b/image", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/mod.rs new file mode 100644 index 0000000000..c10a6ca15e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/mod.rs @@ -0,0 +1,2 @@ +pub mod image; +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/video/mod.rs new file mode 100644 index 0000000000..025047e248 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/4b/video/mod.rs @@ -0,0 +1,32 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct ImageChatOutput { + /// Dictionary of label: mask image/// Dictionary of label: mask image/// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + +pub masks: Vec, +/// Generated output/// Generated output/// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + +pub output: String + } + + + /// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial + pub fn video(params: VideoInput) -> FalRequest { + FalRequest::new( + "fal-ai/sa2va/8b/image", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/image/mod.rs new file mode 100644 index 0000000000..3542a93199 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/image/mod.rs @@ -0,0 +1,32 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct ImageChatOutput { + /// Dictionary of label: mask image/// Dictionary of label: mask image/// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + +pub masks: Vec, +/// Generated output/// Generated output/// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + +pub output: String + } + + + /// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial + pub fn image(params: ImageInput) -> FalRequest { + FalRequest::new( + "fal-ai/sa2va/8b/image", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/mod.rs new file mode 100644 index 0000000000..c10a6ca15e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/mod.rs @@ -0,0 +1,2 @@ +pub mod image; +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/video/mod.rs new file mode 100644 index 0000000000..025047e248 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/8b/video/mod.rs @@ -0,0 +1,32 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct ImageChatOutput { + /// Dictionary of label: mask image/// Dictionary of label: mask image/// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + +pub masks: Vec, +/// Generated output/// Generated output/// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + +pub output: String + } + + + /// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial + pub fn video(params: VideoInput) -> FalRequest { + FalRequest::new( + "fal-ai/sa2va/8b/image", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/mod.rs new file mode 100644 index 0000000000..986d64f5f1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod v4b; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod v8b; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/image/mod.rs new file mode 100644 index 0000000000..d4ad856ff7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/image/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageChatOutput { + /// Dictionary of label: mask image + /// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + pub masks: Vec, + /// Generated output + /// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Url for the Input image. + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the image? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoInput { + /// Number of frames to sample from the video. If not provided, all frames are sampled. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames_to_sample: Option, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the video? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, + /// The URL of the input video. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn image(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/sa2va/4b/image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/mod.rs new file mode 100644 index 0000000000..714c63f508 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/video/mod.rs new file mode 100644 index 0000000000..24b1092572 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v4b/video/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageChatOutput { + /// Dictionary of label: mask image + /// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + pub masks: Vec, + /// Generated output + /// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Url for the Input image. + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the image? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoInput { + /// Number of frames to sample from the video. If not provided, all frames are sampled. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames_to_sample: Option, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the video? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, + /// The URL of the input video. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn video(params: VideoInput) -> FalRequest { + FalRequest::new("fal-ai/sa2va/4b/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/image/mod.rs new file mode 100644 index 0000000000..8126b9a64f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/image/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageChatOutput { + /// Dictionary of label: mask image + /// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + pub masks: Vec, + /// Generated output + /// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Url for the Input image. + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the image? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoInput { + /// Number of frames to sample from the video. If not provided, all frames are sampled. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames_to_sample: Option, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the video? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, + /// The URL of the input video. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn image(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/sa2va/8b/image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/mod.rs new file mode 100644 index 0000000000..714c63f508 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sa2va" + ))) +)] +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/video/mod.rs new file mode 100644 index 0000000000..fc986246da --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sa2va/v8b/video/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageChatOutput { + /// Dictionary of label: mask image + /// [{"content_type":"image/png","file_name":"019c3c1e3c50446e9996f709d36debb4.png","file_size":15724,"height":1200,"url":"https://v3.fal.media/files/monkey/6ITmhHQJ-69s-UxajrY5T_019c3c1e3c50446e9996f709d36debb4.png","width":1800},{"content_type":"image/png","file_name":"0a1522ca410942c7ad6c73efa15b3549.png","file_size":14905,"height":1200,"url":"https://v3.fal.media/files/monkey/IljtMxahoo9-7SUpx0fth_0a1522ca410942c7ad6c73efa15b3549.png","width":1800}] + pub masks: Vec, + /// Generated output + /// "

A white pickup truck

[SEG] is parked on the side of

the red building

[SEG] , creating a unique and eye-catching contrast.<|im_end|>" + pub output: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Url for the Input image. + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the image? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoInput { + /// Number of frames to sample from the video. If not provided, all frames are sampled. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames_to_sample: Option, + /// Prompt to be used for the chat completion + /// "Could you please give me a brief description of the video? Please respond with interleaved segmentation masks for the corresponding parts of the answer." + pub prompt: String, + /// The URL of the input video. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum HeightProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum WidthProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Sa2VA 8B Image +/// +/// Category: vision +/// Machine Type: A100 +/// License Type: commercial +pub fn video(params: VideoInput) -> FalRequest { + FalRequest::new("fal-ai/sa2va/8b/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/mod.rs new file mode 100644 index 0000000000..9867bfb39e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sadtalker" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sadtalker" + ))) +)] +pub mod reference; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SadTalkerInput { + /// URL of the driven audio + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/deyu.wav" + pub driven_audio_url: String, + /// The scale of the expression + #[serde(skip_serializing_if = "Option::is_none")] + pub expression_scale: Option, + /// The type of face enhancer to use + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub face_enhancer: Option, + /// The resolution of the face model + #[serde(skip_serializing_if = "Option::is_none")] + pub face_model_resolution: Option, + /// The style of the pose + #[serde(skip_serializing_if = "Option::is_none")] + pub pose_style: Option, + /// The type of preprocessing to use + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// URL of the source image + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/anime_girl.png" + pub source_image_url: String, + /// Whether to use still mode. Fewer head motion, works with preprocess `full`. + #[serde(skip_serializing_if = "Option::is_none")] + pub still_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SadTalkerOutput { + /// URL of the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SadTalkerRefVideoInput { + /// URL of the driven audio + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/deyu.wav" + pub driven_audio_url: String, + /// The scale of the expression + #[serde(skip_serializing_if = "Option::is_none")] + pub expression_scale: Option, + /// The type of face enhancer to use + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub face_enhancer: Option, + /// The resolution of the face model + #[serde(skip_serializing_if = "Option::is_none")] + pub face_model_resolution: Option, + /// The style of the pose + #[serde(skip_serializing_if = "Option::is_none")] + pub pose_style: Option, + /// The type of preprocessing to use + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// URL of the reference video + /// "https://github.com/OpenTalker/SadTalker/raw/main/examples/ref_video/WDA_AlexandriaOcasioCortez_000.mp4" + pub reference_pose_video_url: String, + /// URL of the source image + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/anime_girl.png" + pub source_image_url: String, + /// Whether to use still mode. Fewer head motion, works with preprocess `full`. + #[serde(skip_serializing_if = "Option::is_none")] + pub still_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Sad Talker +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn sadtalker(params: SadTalkerInput) -> FalRequest { + FalRequest::new("fal-ai/sadtalker", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/reference/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/reference/mod.rs new file mode 100644 index 0000000000..f748dd4878 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sadtalker/reference/mod.rs @@ -0,0 +1,115 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SadTalkerInput { + /// URL of the driven audio + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/deyu.wav" + pub driven_audio_url: String, + /// The scale of the expression + #[serde(skip_serializing_if = "Option::is_none")] + pub expression_scale: Option, + /// The type of face enhancer to use + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub face_enhancer: Option, + /// The resolution of the face model + #[serde(skip_serializing_if = "Option::is_none")] + pub face_model_resolution: Option, + /// The style of the pose + #[serde(skip_serializing_if = "Option::is_none")] + pub pose_style: Option, + /// The type of preprocessing to use + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// URL of the source image + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/anime_girl.png" + pub source_image_url: String, + /// Whether to use still mode. Fewer head motion, works with preprocess `full`. + #[serde(skip_serializing_if = "Option::is_none")] + pub still_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SadTalkerOutput { + /// URL of the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SadTalkerRefVideoInput { + /// URL of the driven audio + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/deyu.wav" + pub driven_audio_url: String, + /// The scale of the expression + #[serde(skip_serializing_if = "Option::is_none")] + pub expression_scale: Option, + /// The type of face enhancer to use + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub face_enhancer: Option, + /// The resolution of the face model + #[serde(skip_serializing_if = "Option::is_none")] + pub face_model_resolution: Option, + /// The style of the pose + #[serde(skip_serializing_if = "Option::is_none")] + pub pose_style: Option, + /// The type of preprocessing to use + #[serde(skip_serializing_if = "Option::is_none")] + pub preprocess: Option, + /// URL of the reference video + /// "https://github.com/OpenTalker/SadTalker/raw/main/examples/ref_video/WDA_AlexandriaOcasioCortez_000.mp4" + pub reference_pose_video_url: String, + /// URL of the source image + /// "https://storage.googleapis.com/falserverless/model_tests/sadtalker/anime_girl.png" + pub source_image_url: String, + /// Whether to use still mode. Fewer head motion, works with preprocess `full`. + #[serde(skip_serializing_if = "Option::is_none")] + pub still_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Sad Talker +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn reference( + params: SadTalkerRefVideoInput, +) -> FalRequest { + FalRequest::new("fal-ai/sadtalker/reference", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/auto_segment/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/auto_segment/mod.rs new file mode 100644 index 0000000000..9df06658f5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/auto_segment/mod.rs @@ -0,0 +1,220 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoxPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// X Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x_max: Option, + /// X Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub x_min: Option, + /// Y Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y_max: Option, + /// Y Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub y_min: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PointPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// Label of the prompt. 1 for foreground, 0 for background + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + /// X Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x: Option, + /// Y Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2AutomaticSegmentationInput { + /// URL of the image to be automatically segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Minimum area of a mask region. + #[serde(skip_serializing_if = "Option::is_none")] + pub min_mask_region_area: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Number of points to sample along each side of the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_side: Option, + /// Threshold for predicted IOU score. + #[serde(skip_serializing_if = "Option::is_none")] + pub pred_iou_thresh: Option, + /// Threshold for stability score. + #[serde(skip_serializing_if = "Option::is_none")] + pub stability_score_thresh: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SAM2AutomaticSegmentationOutput { + /// Combined segmentation mask. + pub combined_mask: Image, + /// Individual segmentation masks. + pub individual_masks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2ImageInput { + /// Coordinates for boxes + /// [{"x_max":700,"x_min":425,"y_max":875,"y_min":600}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// URL of the image to be segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// List of prompts to segment the image + /// [{"label":1,"x":500,"y":375}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2ImageOutput { + /// Segmented image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2RLEOutput { + /// Run Length Encoding of the mask. + pub rle: RleProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoOutput { + /// The segmented video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoRLEInput { + /// Apply the mask on the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_mask: Option, + /// Coordinates for boxes + /// [{"frame_index":0,"x_max":500,"x_min":300,"y_max":400,"y_min":0}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// The URL of the mask to be applied initially. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// List of prompts to segment the video + /// [{"frame_index":0,"label":1,"x":210,"y":350},{"frame_index":0,"label":1,"x":250,"y":220}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// The URL of the video to be segmented. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum RleProperty { + #[default] + String(String), + Array(Vec), +} + +/// Segment Anything Model 2 +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn auto_segment( + params: SAM2AutomaticSegmentationInput, +) -> FalRequest { + FalRequest::new("fal-ai/sam2/auto-segment", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image/mod.rs new file mode 100644 index 0000000000..8a6ce52f1d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image/mod.rs @@ -0,0 +1,218 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoxPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// X Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x_max: Option, + /// X Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub x_min: Option, + /// Y Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y_max: Option, + /// Y Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub y_min: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PointPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// Label of the prompt. 1 for foreground, 0 for background + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + /// X Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x: Option, + /// Y Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2AutomaticSegmentationInput { + /// URL of the image to be automatically segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Minimum area of a mask region. + #[serde(skip_serializing_if = "Option::is_none")] + pub min_mask_region_area: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Number of points to sample along each side of the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_side: Option, + /// Threshold for predicted IOU score. + #[serde(skip_serializing_if = "Option::is_none")] + pub pred_iou_thresh: Option, + /// Threshold for stability score. + #[serde(skip_serializing_if = "Option::is_none")] + pub stability_score_thresh: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2AutomaticSegmentationOutput { + /// Combined segmentation mask. + pub combined_mask: Image, + /// Individual segmentation masks. + pub individual_masks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2ImageInput { + /// Coordinates for boxes + /// [{"x_max":700,"x_min":425,"y_max":875,"y_min":600}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// URL of the image to be segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// List of prompts to segment the image + /// [{"label":1,"x":500,"y":375}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SAM2ImageOutput { + /// Segmented image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2RLEOutput { + /// Run Length Encoding of the mask. + pub rle: RleProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoOutput { + /// The segmented video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoRLEInput { + /// Apply the mask on the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_mask: Option, + /// Coordinates for boxes + /// [{"frame_index":0,"x_max":500,"x_min":300,"y_max":400,"y_min":0}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// The URL of the mask to be applied initially. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// List of prompts to segment the video + /// [{"frame_index":0,"label":1,"x":210,"y":350},{"frame_index":0,"label":1,"x":250,"y":220}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// The URL of the video to be segmented. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum RleProperty { + #[default] + String(String), + Array(Vec), +} + +/// Segment Anything Model 2 +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn image(params: SAM2ImageInput) -> FalRequest { + FalRequest::new("fal-ai/sam2/image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image_rle/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image_rle/mod.rs new file mode 100644 index 0000000000..3a46b3d5a8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/image_rle/mod.rs @@ -0,0 +1,218 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BoxPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// X Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x_max: Option, + /// X Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub x_min: Option, + /// Y Max Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y_max: Option, + /// Y Min Coordinate of the box + #[serde(skip_serializing_if = "Option::is_none")] + pub y_min: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PointPrompt { + /// The frame index to interact with. + #[serde(skip_serializing_if = "Option::is_none")] + pub frame_index: Option, + /// Label of the prompt. 1 for foreground, 0 for background + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + /// X Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub x: Option, + /// Y Coordinate of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub y: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2AutomaticSegmentationInput { + /// URL of the image to be automatically segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// Minimum area of a mask region. + #[serde(skip_serializing_if = "Option::is_none")] + pub min_mask_region_area: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Number of points to sample along each side of the image. + #[serde(skip_serializing_if = "Option::is_none")] + pub points_per_side: Option, + /// Threshold for predicted IOU score. + #[serde(skip_serializing_if = "Option::is_none")] + pub pred_iou_thresh: Option, + /// Threshold for stability score. + #[serde(skip_serializing_if = "Option::is_none")] + pub stability_score_thresh: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2AutomaticSegmentationOutput { + /// Combined segmentation mask. + pub combined_mask: Image, + /// Individual segmentation masks. + pub individual_masks: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2ImageInput { + /// Coordinates for boxes + /// [{"x_max":700,"x_min":425,"y_max":875,"y_min":600}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// URL of the image to be segmented + /// "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg" + pub image_url: String, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// List of prompts to segment the image + /// [{"label":1,"x":500,"y":375}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2ImageOutput { + /// Segmented image. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SAM2RLEOutput { + /// Run Length Encoding of the mask. + pub rle: RleProperty, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoOutput { + /// The segmented video. + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SAM2VideoRLEInput { + /// Apply the mask on the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub apply_mask: Option, + /// Coordinates for boxes + /// [{"frame_index":0,"x_max":500,"x_min":300,"y_max":400,"y_min":0}] + #[serde(skip_serializing_if = "Option::is_none")] + pub box_prompts: Option>>, + /// The URL of the mask to be applied initially. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_url: Option, + /// List of prompts to segment the video + /// [{"frame_index":0,"label":1,"x":210,"y":350},{"frame_index":0,"label":1,"x":250,"y":220}] + #[serde(skip_serializing_if = "Option::is_none")] + pub prompts: Option>>, + /// The URL of the video to be segmented. + /// "https://drive.google.com/uc?id=1iOFYbNITYwrebBBp9kaEGhBndFSRLz8k" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum RleProperty { + #[default] + String(String), + Array(Vec), +} + +/// Segment Anything Model 2 +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn image_rle(params: SAM2ImageInput) -> FalRequest { + FalRequest::new("fal-ai/sam2/image-rle", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/mod.rs new file mode 100644 index 0000000000..0456f7409b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sam2/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" + ))) +)] +pub mod auto_segment; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" + ))) +)] +pub mod image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sam2" + ))) +)] +pub mod image_rle; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sana/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sana/mod.rs new file mode 100644 index 0000000000..7901b6e5e9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sana/mod.rs @@ -0,0 +1,132 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Underwater coral reef ecosystem during peak bioluminescent activity, multiple layers of marine life - from microscopic plankton to massive coral structures, light refracting through crystal-clear tropical waters, creating prismatic color gradients, hyper-detailed texture of marine organisms" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The style to generate the image in. + #[serde(skip_serializing_if = "Option::is_none")] + pub style_name: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Sana +/// +/// Category: text-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn sana(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/sana", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/image_to_image/mod.rs new file mode 100644 index 0000000000..1a887d70c4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/image_to_image/mod.rs @@ -0,0 +1,273 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SD 1.5 Depth ControlNet +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn image_to_image( + params: ImageToImageControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/sd15-depth-controlnet/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/inpainting/mod.rs new file mode 100644 index 0000000000..e57526ef4c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/inpainting/mod.rs @@ -0,0 +1,273 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SD 1.5 Depth ControlNet +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn inpainting( + params: InpaintingControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/sd15-depth-controlnet/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/mod.rs new file mode 100644 index 0000000000..3f0b661d1f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sd15_depth_controlnet/mod.rs @@ -0,0 +1,302 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sd15-depth-controlnet" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + pub control_image_url: String, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// If set to true, DeepCache will be enabled. TBD + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_deep_cache: Option, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SD 1.5 Depth ControlNet +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn sd15_depth_controlnet( + params: TextToImageControlNetInput, +) -> FalRequest { + FalRequest::new("fal-ai/sd15-depth-controlnet", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/image_to_image/mod.rs new file mode 100644 index 0000000000..d3977e21b0 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/image_to_image/mod.rs @@ -0,0 +1,441 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SDXL ControlNet Union +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn image_to_image( + params: ImageToImageControlNetUnionInput, +) -> FalRequest { + FalRequest::new("fal-ai/sdxl-controlnet-union/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/inpainting/mod.rs new file mode 100644 index 0000000000..1053779c9c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/inpainting/mod.rs @@ -0,0 +1,441 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SDXL ControlNet Union +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn inpainting( + params: InpaintingControlNetUnionInput, +) -> FalRequest { + FalRequest::new("fal-ai/sdxl-controlnet-union/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/mod.rs new file mode 100644 index 0000000000..1f615661d1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sdxl_controlnet_union/mod.rs @@ -0,0 +1,470 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sdxl-controlnet-union" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// If set to true, the embedding will be forced to be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub force: Option, + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageControlNetUnionInput { + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_image_url: Option, + /// Whether to preprocess the canny image. + #[serde(skip_serializing_if = "Option::is_none")] + pub canny_preprocess: Option, + /// The scale of the controlnet conditioning. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet_conditioning_scale: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_image_url: Option, + /// Whether to preprocess the depth image. + #[serde(skip_serializing_if = "Option::is_none")] + pub depth_preprocess: Option, + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Leave it none to automatically infer from the control image. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_image_url: Option, + /// Whether to preprocess the normal image. + #[serde(skip_serializing_if = "Option::is_none")] + pub normal_preprocess: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_image_url: Option, + /// Whether to preprocess the openpose image. + #[serde(skip_serializing_if = "Option::is_none")] + pub openpose_preprocess: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "Ice fortress, aurora skies, polar wildlife, twilight" + pub prompt: String, + /// An id bound to a request, can be used with response to identify the request + /// itself. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_id: Option, + /// The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. + #[serde(skip_serializing_if = "Option::is_none")] + pub safety_checker_version: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_image_url: Option, + /// Whether to preprocess the segmentation image. + #[serde(skip_serializing_if = "Option::is_none")] + pub segmentation_preprocess: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// The URL of the control image. + /// "https://fal-cdn.batuhan-941.workers.dev/files/rabbit/MiN_j3St9B8esJleCZKMU.jpeg" + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_image_url: Option, + /// Whether to preprocess the teed image. + #[serde(skip_serializing_if = "Option::is_none")] + pub teed_preprocess: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// SDXL ControlNet Union +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn sdxl_controlnet_union( + params: TextToImageControlNetUnionInput, +) -> FalRequest { + FalRequest::new("fal-ai/sdxl-controlnet-union", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/skyreels_i2v/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/skyreels_i2v/mod.rs new file mode 100644 index 0000000000..10b0479a08 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/skyreels_i2v/mod.rs @@ -0,0 +1,87 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SkyreelsI2VRequest { + /// Aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Guidance scale for generation (between 1.0 and 20.0) + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// URL of the image input. + /// "https://fal.media/files/panda/TuXlMwArpQcdYNCLAEM8K.webp" + pub image_url: String, + /// Negative prompt to guide generation away from certain attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of denoising steps (between 1 and 50). Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Random seed for generation. If not provided, a random seed will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SkyreelsI2VResponse { + /// The seed used for generation + /// 42 + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Skyreels V1 (Image-to-Video) +/// +/// Category: image-to-video +/// Machine Type: H100 +/// +/// +/// Skyreels Image-to-Video API for fast video generation. +pub fn skyreels_i2v( + params: SkyreelsI2VRequest, +) -> FalRequest { + FalRequest::new("fal-ai/skyreels-i2v", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_audio/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_audio/mod.rs new file mode 100644 index 0000000000..3ea9130075 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_audio/mod.rs @@ -0,0 +1,71 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The prompt to generate audio from + /// "128 BPM tech house drum loop" + pub prompt: String, + /// The start point of the audio clip to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub seconds_start: Option, + /// The duration of the audio clip to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub seconds_total: Option, + /// The number of steps to denoise the audio for + #[serde(skip_serializing_if = "Option::is_none")] + pub steps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The generated audio clip + pub audio_file: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Stable Audio Open +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn stable_audio(params: Input) -> FalRequest { + FalRequest::new("fal-ai/stable-audio", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/mod.rs new file mode 100644 index 0000000000..8828792ae8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/mod.rs @@ -0,0 +1,189 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-cascade" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-cascade" + ))) +)] +pub mod sote_diffusion; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoteDiffusionInput { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Number of steps to run the first stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_stage_steps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "very displeasing, worst quality, monochrome, realistic, oldest" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "newest, extremely aesthetic, best quality, 1girl, solo, pink hair, blue eyes, long hair, looking at viewer, smile, black background, holding a sign, the text on the sign says \"Hello\"" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_guidance_scale: Option, + /// Number of steps to run the second stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_steps: Option, + /// The same seed and the same prompt given to the same version of Stable Cascade + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the image will be returned as base64 encoded string. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StableCascadeInput { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Number of steps to run the first stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_stage_steps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "An image of a shiba inu, donning a spacesuit and helmet" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_guidance_scale: Option, + /// Number of steps to run the second stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_steps: Option, + /// The same seed and the same prompt given to the same version of Stable Cascade + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the image will be returned as base64 encoded string. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Cascade +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: research +pub fn stable_cascade(params: StableCascadeInput) -> FalRequest { + FalRequest::new("fal-ai/stable-cascade", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/sote_diffusion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/sote_diffusion/mod.rs new file mode 100644 index 0000000000..d4c695c5e2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_cascade/sote_diffusion/mod.rs @@ -0,0 +1,174 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SoteDiffusionInput { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Number of steps to run the first stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_stage_steps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "very displeasing, worst quality, monochrome, realistic, oldest" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "newest, extremely aesthetic, best quality, 1girl, solo, pink hair, blue eyes, long hair, looking at viewer, smile, black background, holding a sign, the text on the sign says \"Hello\"" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_guidance_scale: Option, + /// Number of steps to run the second stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_steps: Option, + /// The same seed and the same prompt given to the same version of Stable Cascade + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the image will be returned as base64 encoded string. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StableCascadeInput { + /// If set to false, the safety checker will be disabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Number of steps to run the first stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_stage_steps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "An image of a shiba inu, donning a spacesuit and helmet" + pub prompt: String, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_guidance_scale: Option, + /// Number of steps to run the second stage for. + #[serde(skip_serializing_if = "Option::is_none")] + pub second_stage_steps: Option, + /// The same seed and the same prompt given to the same version of Stable Cascade + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the image will be returned as base64 encoded string. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Cascade +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: research +pub fn sote_diffusion(params: SoteDiffusionInput) -> FalRequest { + FalRequest::new("fal-ai/stable-cascade/sote-diffusion", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/image_to_image/mod.rs new file mode 100644 index 0000000000..8bce475251 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/image_to_image/mod.rs @@ -0,0 +1,277 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion v1.5 +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn image_to_image(params: ImageToImageSD15Input) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v15/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/inpainting/mod.rs new file mode 100644 index 0000000000..075eacd3c1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/inpainting/mod.rs @@ -0,0 +1,277 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion v1.5 +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn inpainting(params: InpaintingSD15Input) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v15/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/mod.rs new file mode 100644 index 0000000000..ce9fe0dc44 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v15/mod.rs @@ -0,0 +1,308 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v15" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Embedding { + /// URL or the path to the embedding weights. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The list of tokens to use for the embedding. + #[serde(skip_serializing_if = "Option::is_none")] + pub tokens: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintingSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The URL of the mask to use for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The negative prompt to use.Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "a tiger sitting on a park bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// determines how much the generated image resembles the initial image + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. Or HF model name. + /// "https://civitai.com/api/download/models/135931" + /// "https://filebin.net/3chfqasxpqu21y8n/my-custom-lora-v1.safetensors" + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageSD15Input { + /// The list of embeddings to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub embeddings: Option>>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// If set to true, the prompt will be expanded with additional prompts. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The list of LoRA weights to use. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "cartoon, illustration, animation. face. male, female" + /// "ugly, deformed" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to use for generating the image. Be as descriptive as possible for best results. + /// "photo of a rhino dressed suit and tie sitting at a table in a bar with a bar stools, award winning photography, Elke vogelsang" + /// "Photo of a classic red mustang car parked in las vegas strip at night" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion v1.5 +/// +/// Category: text-to-image +/// Machine Type: A6000 +pub fn stable_diffusion_v15( + params: TextToImageSD15Input, +) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v15", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/image_to_image/mod.rs new file mode 100644 index 0000000000..ed47645796 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/image_to_image/mod.rs @@ -0,0 +1,455 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-large/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/inpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/inpaint/mod.rs new file mode 100644 index 0000000000..351108d8cb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/inpaint/mod.rs @@ -0,0 +1,455 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn inpaint(params: InpaintInput) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-large/inpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/mod.rs new file mode 100644 index 0000000000..9c836e3f7c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/mod.rs @@ -0,0 +1,500 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod inpaint; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod turbo; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn stable_diffusion_v35_large( + params: TextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-large", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/image_to_image/mod.rs new file mode 100644 index 0000000000..59a6429ddf --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/image_to_image/mod.rs @@ -0,0 +1,460 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn image_to_image( + params: ImageToImageTurboInput, +) -> FalRequest { + FalRequest::new( + "fal-ai/stable-diffusion-v35-large/turbo/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/inpaint/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/inpaint/mod.rs new file mode 100644 index 0000000000..28a21a7636 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/inpaint/mod.rs @@ -0,0 +1,455 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn inpaint(params: InpaintTurboInput) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-large/turbo/inpaint", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/mod.rs new file mode 100644 index 0000000000..caa41b1633 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_large/turbo/mod.rs @@ -0,0 +1,484 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v35-large" + ))) +)] +pub mod inpaint; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ControlNet { + /// The scale of the control net weight. This is used to scale the control net weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub conditioning_scale: Option, + /// URL of the image to be used as the control image. + pub control_image_url: String, + /// The percentage of the image to end applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_percentage: Option, + /// URL or the path to the control net weights. + pub path: String, + /// The percentage of the image to start applying the controlnet in terms of the total timesteps. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_percentage: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct IPAdapter { + /// Path to the Image Encoder for the IP-Adapter, for example 'openai/clip-vit-large-patch14' + pub image_encoder_path: String, + /// Subfolder in which the image encoder weights exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_subfolder: Option, + /// Name of the image encoder. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_encoder_weight_name: Option, + /// URL of Image for IP-Adapter conditioning. + pub image_url: String, + /// URL of the mask for the control image. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Threshold for mask. + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_threshold: Option, + /// Hugging Face path to the IP-Adapter + pub path: String, + /// Scale for ip adapter. + pub scale: f64, + /// Subfolder in which the ip_adapter weights exist + #[serde(skip_serializing_if = "Option::is_none")] + pub subfolder: Option, + /// Name of the safetensors file containing the ip-adapter weights + #[serde(skip_serializing_if = "Option::is_none")] + pub weight_name: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for Image-to-Image + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Cat sitting on a bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of Image for inpainting + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// URL of mask image for inpainting. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_image_url: String, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Tiger sitting on a bench." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Strength for Image-to-Image. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// ControlNet for inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub controlnet: Option>, + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// IP-Adapter to use during inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_adapter: Option>, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageTurboInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to landscape_4_3 if no controlnet has been passed, otherwise defaults to the size of the controlnet conditioning image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Large +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn turbo(params: TextToImageTurboInput) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-large/turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_medium/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_medium/mod.rs new file mode 100644 index 0000000000..cc9c54aaf8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v35_medium/mod.rs @@ -0,0 +1,131 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A dreamlike Japanese garden in perpetual twilight, bathed in bioluminescent cherry blossoms that emit a soft pink-purple glow. Floating paper lanterns drift lazily through the scene, their warm light creating dancing reflections in a mirror-like koi pond. Ethereal mist weaves between ancient stone pathways lined with glowing mushrooms in pastel blues and purples. A traditional wooden bridge arches gracefully over the water, dusted with fallen petals that sparkle like stardust. The scene is captured through a cinematic lens with perfect bokeh, creating an otherworldly atmosphere. In the background, a crescent moon hangs impossibly large in the sky, surrounded by a sea of stars and auroral wisps in teal and violet. Crystal formations emerge from the ground, refracting the ambient light into rainbow prisms. The entire composition follows the golden ratio, with moody film-like color grading reminiscent of Studio Ghibli, enhanced by volumetric god rays filtering through the luminous foliage. 8K resolution, masterful photography, hyperdetailed, magical realism." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion 3.5 Medium +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn stable_diffusion_v35_medium( + params: TextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v35-medium", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/image_to_image/mod.rs new file mode 100644 index 0000000000..c8d6a5b51b --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/image_to_image/mod.rs @@ -0,0 +1,173 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to the conditioning image's size. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. + /// "https://fal.media/files/zebra/b52cVi3BhLDJcBrk6x0DL.png" + pub image_url: String, + /// The negative prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k" + pub prompt: String, + /// If set to true, prompt will be upsampled with more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_expansion: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the image-to-image transformation. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SD3Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The number of images generated. + pub num_images: i64, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Digital art, portrait of an anthropomorphic roaring Tiger warrior with full armor, close up in the middle of a battle, behind him there is a banner with the text \"Open Source\"" + pub prompt: String, + /// If set to true, prompt will be upsampled with more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_expansion: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion V3 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v3-medium/image-to-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/mod.rs new file mode 100644 index 0000000000..c0b89cfe31 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_diffusion_v3_medium/mod.rs @@ -0,0 +1,190 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium" + ))) +)] +pub mod image_to_image; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. Defaults to the conditioning image's size. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The image URL to generate an image from. + /// "https://fal.media/files/zebra/b52cVi3BhLDJcBrk6x0DL.png" + pub image_url: String, + /// The negative prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k" + pub prompt: String, + /// If set to true, prompt will be upsampled with more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_expansion: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the image-to-image transformation. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SD3Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The number of images generated. + pub num_images: i64, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The negative prompt to generate an image from. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Digital art, portrait of an anthropomorphic roaring Tiger warrior with full armor, close up in the middle of a battle, behind him there is a banner with the text \"Open Source\"" + pub prompt: String, + /// If set to true, prompt will be upsampled with more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_expansion: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Stable Diffusion V3 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn stable_diffusion_v3_medium( + params: TextToImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/stable-diffusion-v3-medium", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/mod.rs new file mode 100644 index 0000000000..03de7a9b3c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-video" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_stable-video" + ))) +)] +pub mod text_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The frames per second of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The negative prompt to use as a starting point for the generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// Seed for random number generator + pub seed: i64, + /// Generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// High Quality Stable Video Diffusion +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn stable_video(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/stable-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/text_to_video/mod.rs new file mode 100644 index 0000000000..c40837fb16 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stable_video/text_to_video/mod.rs @@ -0,0 +1,140 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The frames per second of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub fps: Option, + /// The URL of the image to use as a starting point for the generation. + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/mustang.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/ship.png" + /// "https://storage.googleapis.com/falserverless/model_tests/svd/rocket2.png" + pub image_url: String, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextInput { + /// The conditoning augmentation determines the amount of noise that will be + /// added to the conditioning frame. The higher the number, the more noise + /// there will be, and the less the video will look like the initial image. + /// Increase it for more motion. + #[serde(skip_serializing_if = "Option::is_none")] + pub cond_aug: Option, + /// The motion bucket id determines the motion of the generated video. The + /// higher the number, the more motion there will be. + #[serde(skip_serializing_if = "Option::is_none")] + pub motion_bucket_id: Option, + /// The negative prompt to use as a starting point for the generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The prompt to use as a starting point for the generation. + /// "A rocket flying that is about to take off" + pub prompt: String, + /// The same seed and the same prompt given to the same version of Stable Diffusion + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The size of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub video_size: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// Seed for random number generator + pub seed: i64, + /// Generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum VideoSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +/// High Quality Stable Video Diffusion +/// +/// Category: image-to-video +/// Machine Type: A100 +pub fn text_to_video(params: TextInput) -> FalRequest { + FalRequest::new("fal-ai/stable-video/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/stepfun_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/stepfun_video/mod.rs new file mode 100644 index 0000000000..7451cbebeb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/stepfun_video/mod.rs @@ -0,0 +1,75 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StepFunT2VRequest { + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The number of inference steps to run. Lower gets faster results, higher gets better results. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// The seed to use for generating the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct StepFunT2VResponse { + /// The seed used for generating the video. + pub seed: i64, + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Step-Video +/// +/// Category: text-to-video +/// Machine Type: H100 +pub fn stepfun_video( + params: StepFunT2VRequest, +) -> FalRequest { + FalRequest::new("fal-ai/stepfun-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/swin2sr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/swin2sr/mod.rs new file mode 100644 index 0000000000..f6e2a2fa67 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/swin2sr/mod.rs @@ -0,0 +1,76 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SwinSrInput { + /// URL of image to be used for image enhancement + /// "https://storage.googleapis.com/falserverless/gallery/seoul.jpg" + pub image_url: String, + /// seed to be used for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Task to perform + #[serde(skip_serializing_if = "Option::is_none")] + pub task: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SwinSrOutput { + /// The generated image file info. + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// SWIN2SR +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn swin2sr(params: SwinSrInput) -> FalRequest { + FalRequest::new("fal-ai/swin2sr", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/512/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/512/mod.rs new file mode 100644 index 0000000000..07e49be597 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/512/mod.rs @@ -0,0 +1,37 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct SwittiOutput { + /// Whether the generated images contain NSFW concepts. +pub has_nsfw_concepts: Vec, +/// The generated images/// The generated images/// [{"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/lion/JpgBX7w379jHteLeeNsM5.jpeg","width":1024}] + +pub images: Vec, +/// The prompt used for generating the image. +pub prompt: String, +/// Seed of the generated Image. It will be the same value of the one passed in the +/// input or the randomly generated that was used in case none was passed. +pub seed: i64, +pub timings: Timings + } + + + /// Switti 1024 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial + pub fn 512(params: TextToImageInput) -> FalRequest { + FalRequest::new( + "fal-ai/switti", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/mod.rs new file mode 100644 index 0000000000..2ec647a51a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/mod.rs @@ -0,0 +1,148 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_switti" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_switti" + ))) +)] +pub mod v512; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SwittiOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated images + /// [{"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/lion/JpgBX7w379jHteLeeNsM5.jpeg","width":1024}] + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Temperature after disabling CFG + #[serde(skip_serializing_if = "Option::is_none")] + pub last_scale_temp: Option, + /// More diverse sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub more_diverse: Option, + /// Smoothing with Gumbel softmax sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub more_smooth: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A cat wearing a hoodie with 'FAL' written on it." + pub prompt: String, + /// The number of top-k tokens to sample from. + #[serde(skip_serializing_if = "Option::is_none")] + pub sampling_top_k: Option, + /// The top-p probability to sample from. + #[serde(skip_serializing_if = "Option::is_none")] + pub sampling_top_p: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Smoothing starting scale + #[serde(skip_serializing_if = "Option::is_none")] + pub smooth_start_si: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Disable CFG starting scale + #[serde(skip_serializing_if = "Option::is_none")] + pub turn_off_cfg_start_si: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Switti 1024 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn switti(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/switti", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/v512/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/v512/mod.rs new file mode 100644 index 0000000000..4bb6db846a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/switti/v512/mod.rs @@ -0,0 +1,133 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SwittiOutput { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated images + /// [{"content_type":"image/jpeg","height":1024,"url":"https://fal.media/files/lion/JpgBX7w379jHteLeeNsM5.jpeg","width":1024}] + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Temperature after disabling CFG + #[serde(skip_serializing_if = "Option::is_none")] + pub last_scale_temp: Option, + /// More diverse sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub more_diverse: Option, + /// Smoothing with Gumbel softmax sampling + #[serde(skip_serializing_if = "Option::is_none")] + pub more_smooth: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small details + /// (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A cat wearing a hoodie with 'FAL' written on it." + pub prompt: String, + /// The number of top-k tokens to sample from. + #[serde(skip_serializing_if = "Option::is_none")] + pub sampling_top_k: Option, + /// The top-p probability to sample from. + #[serde(skip_serializing_if = "Option::is_none")] + pub sampling_top_p: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Smoothing starting scale + #[serde(skip_serializing_if = "Option::is_none")] + pub smooth_start_si: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Disable CFG starting scale + #[serde(skip_serializing_if = "Option::is_none")] + pub turn_off_cfg_start_si: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Switti 1024 +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +pub fn v512(params: TextToImageInput) -> FalRequest { + FalRequest::new("fal-ai/switti/512", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/mod.rs new file mode 100644 index 0000000000..e426a84962 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/mod.rs @@ -0,0 +1,111 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync" + ))) +)] +pub mod v2; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncInput { + /// URL of the input audio + /// "https://fal.media/files/lion/vyFWygmZsIZlUO4s0nr2n.wav" + pub audio_url: String, + /// The model to use for lipsyncing + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Lipsync mode when audio and video durations are out of sync. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// URL of the input video + /// "https://fal.media/files/koala/8teUPbRRMtAUTORDvqy0l.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LipSyncOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/rabbit/6gJV-z7RJsF0AxkZHkdgJ_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncV2Input { + /// URL of the input audio + /// "https://fal.media/files/lion/vyFWygmZsIZlUO4s0nr2n.wav" + pub audio_url: String, + /// The model to use for lipsyncing + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Lipsync mode when audio and video durations are out of sync. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// URL of the input video + /// "https://fal.media/files/koala/8teUPbRRMtAUTORDvqy0l.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncV2Output { + /// The generated video + /// {"url":"https://v3.fal.media/files/elephant/r5mUYNbrSeEhfr4etMIvE_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// sync.so -- lipsync 1.9.0-beta +/// +/// Category: video-to-video +/// +/// License Type: commercial +pub fn sync_lipsync(params: LipSyncInput) -> FalRequest { + FalRequest::new("fal-ai/sync-lipsync", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/v2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/v2/mod.rs new file mode 100644 index 0000000000..266f82c56f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/sync_lipsync/v2/mod.rs @@ -0,0 +1,96 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncInput { + /// URL of the input audio + /// "https://fal.media/files/lion/vyFWygmZsIZlUO4s0nr2n.wav" + pub audio_url: String, + /// The model to use for lipsyncing + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Lipsync mode when audio and video durations are out of sync. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// URL of the input video + /// "https://fal.media/files/koala/8teUPbRRMtAUTORDvqy0l.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/rabbit/6gJV-z7RJsF0AxkZHkdgJ_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LipSyncV2Input { + /// URL of the input audio + /// "https://fal.media/files/lion/vyFWygmZsIZlUO4s0nr2n.wav" + pub audio_url: String, + /// The model to use for lipsyncing + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Lipsync mode when audio and video durations are out of sync. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// URL of the input video + /// "https://fal.media/files/koala/8teUPbRRMtAUTORDvqy0l.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct LipSyncV2Output { + /// The generated video + /// {"url":"https://v3.fal.media/files/elephant/r5mUYNbrSeEhfr4etMIvE_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// sync.so -- lipsync 1.9.0-beta +/// +/// Category: video-to-video +/// +/// License Type: commercial +pub fn v2(params: LipSyncV2Input) -> FalRequest { + FalRequest::new("fal-ai/sync-lipsync/v2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/t2v_turbo/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/t2v_turbo/mod.rs new file mode 100644 index 0000000000..fe834e591d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/t2v_turbo/mod.rs @@ -0,0 +1,106 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The FPS of the exported video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The guidance scale + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The number of frames to generate + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// The number of steps to sample + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate images from + /// "a dog wearing vr goggles on a boat" + pub prompt: String, + /// The seed to use for the random number generator + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The URL to the generated video + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// T2V Turbo - Video Crafter +/// +/// Category: text-to-video +/// Machine Type: A100 +pub fn t2v_turbo(params: Input) -> FalRequest { + FalRequest::new("fal-ai/t2v-turbo", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/thera/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/thera/mod.rs new file mode 100644 index 0000000000..fb3a5c094e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/thera/mod.rs @@ -0,0 +1,81 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TheraInput { + /// Backbone to use for upscaling + /// "edsr" + pub backbone: String, + /// URL of image to be used for upscaling + /// "https://storage.googleapis.com/falserverless/docres_ckpt/NoN6cImXI9DCeEYzX7-a7_1224f6da06354948ab477fa450e8c4f6.png" + pub image_url: String, + /// Random seed for reproducible generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub upscaling: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TheraOutput { + /// The generated image file info. + pub image: Image, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Thera +/// +/// Category: image-to-image +/// Machine Type: A100 +pub fn thera(params: TheraInput) -> FalRequest { + FalRequest::new("fal-ai/thera", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/mod.rs new file mode 100644 index 0000000000..9119f65c6c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod slowmotion; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod upscale; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/mod.rs new file mode 100644 index 0000000000..906f3b4ce2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/video/mod.rs new file mode 100644 index 0000000000..cbbf972b66 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/slowmotion/video/mod.rs @@ -0,0 +1,154 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RecoverUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the low-quality video to upscale and recover + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SlowMotionRequest { + /// Factor to slow down the video by (e.g. 4 means 4x slower) + #[serde(skip_serializing_if = "Option::is_none")] + pub slowdown_factor: Option, + /// Optional factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to apply slow motion to + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StrongAIUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Target height of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_height: Option, + /// Target width of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_width: Option, + /// URL of the AI-generated video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoUpscaleOutput { + /// The upscaled video file + /// {"url":"https://v3.fal.media/files/penguin/ztj_LB4gQlW6HIfVs8zX4_upscaled.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoUpscaleRequest { + /// Target FPS for frame interpolation. If set, frame interpolation will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum TargetFpsProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum UpscaleFactorProperty { + #[default] + Number(f64), + Null(serde_json::Value), +} + +/// Topaz Video Upscale +/// +/// Category: video-to-video +/// +/// +/// +/// Apply slow motion to videos, optionally with upscaling. +/// +/// Uses Apollo v8 model to slow down videos up to 8x. Can also upscale the video +/// simultaneously if upscale_factor is specified. +pub fn video(params: SlowMotionRequest) -> FalRequest { + FalRequest::new("fal-ai/topaz/slowmotion/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/mod.rs new file mode 100644 index 0000000000..a59f7501b3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod recover_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod v4x_generative_upscale; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_topaz" + ))) +)] +pub mod video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/recover_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/recover_video/mod.rs new file mode 100644 index 0000000000..5471e9fd6e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/recover_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RecoverUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the low-quality video to upscale and recover + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SlowMotionRequest { + /// Factor to slow down the video by (e.g. 4 means 4x slower) + #[serde(skip_serializing_if = "Option::is_none")] + pub slowdown_factor: Option, + /// Optional factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to apply slow motion to + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StrongAIUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Target height of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_height: Option, + /// Target width of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_width: Option, + /// URL of the AI-generated video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoUpscaleOutput { + /// The upscaled video file + /// {"url":"https://v3.fal.media/files/penguin/ztj_LB4gQlW6HIfVs8zX4_upscaled.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoUpscaleRequest { + /// Target FPS for frame interpolation. If set, frame interpolation will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum TargetFpsProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum UpscaleFactorProperty { + #[default] + Number(f64), + Null(serde_json::Value), +} + +/// Topaz Video Upscale +/// +/// Category: video-to-video +/// +/// +/// +/// Upscale and recover low quality input videos with high compression or blur. +/// +/// Uses Proteus v4 model with specialized settings for compression recovery. +pub fn recover_video( + params: RecoverUpscaleRequest, +) -> FalRequest { + FalRequest::new("fal-ai/topaz/upscale/recover-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/v4x_generative_upscale/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/v4x_generative_upscale/mod.rs new file mode 100644 index 0000000000..06c9d5b9cc --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/v4x_generative_upscale/mod.rs @@ -0,0 +1,156 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RecoverUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the low-quality video to upscale and recover + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SlowMotionRequest { + /// Factor to slow down the video by (e.g. 4 means 4x slower) + #[serde(skip_serializing_if = "Option::is_none")] + pub slowdown_factor: Option, + /// Optional factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to apply slow motion to + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StrongAIUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Target height of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_height: Option, + /// Target width of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_width: Option, + /// URL of the AI-generated video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoUpscaleOutput { + /// The upscaled video file + /// {"url":"https://v3.fal.media/files/penguin/ztj_LB4gQlW6HIfVs8zX4_upscaled.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoUpscaleRequest { + /// Target FPS for frame interpolation. If set, frame interpolation will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum TargetFpsProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum UpscaleFactorProperty { + #[default] + Number(f64), + Null(serde_json::Value), +} + +/// Topaz Video Upscale +/// +/// Category: video-to-video +/// +/// +/// +/// Upscale AI-generated videos for maximum detail generation and preservation. +/// +/// Uses Rhea-1 model specifically designed for AI-generated content. This model always internally +/// upscales to 4x the input size, then scales to the target resolution. +pub fn v4x_generative_upscale( + params: StrongAIUpscaleRequest, +) -> FalRequest { + FalRequest::new("fal-ai/topaz/upscale/4x-generative-upscale", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/video/mod.rs new file mode 100644 index 0000000000..be1d020633 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/topaz/upscale/video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RecoverUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the low-quality video to upscale and recover + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SlowMotionRequest { + /// Factor to slow down the video by (e.g. 4 means 4x slower) + #[serde(skip_serializing_if = "Option::is_none")] + pub slowdown_factor: Option, + /// Optional factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to apply slow motion to + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StrongAIUpscaleRequest { + /// Target FPS for the output video. Defaults to source FPS if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Target height of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_height: Option, + /// Target width of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub target_width: Option, + /// URL of the AI-generated video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoUpscaleOutput { + /// The upscaled video file + /// {"url":"https://v3.fal.media/files/penguin/ztj_LB4gQlW6HIfVs8zX4_upscaled.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoUpscaleRequest { + /// Target FPS for frame interpolation. If set, frame interpolation will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_fps: Option, + /// Factor to upscale the video by (e.g. 2.0 doubles width and height) + #[serde(skip_serializing_if = "Option::is_none")] + pub upscale_factor: Option, + /// URL of the video to upscale + /// "https://v3.fal.media/files/kangaroo/y5-1YTGpun17eSeggZMzX_video-1733468228.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum TargetFpsProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum UpscaleFactorProperty { + #[default] + Number(f64), + Null(serde_json::Value), +} + +/// Topaz Video Upscale +/// +/// Category: video-to-video +/// +/// +/// +/// Upscale videos using Topaz Video AI. +/// +/// Uses Proteus v4 for upscaling and optionally Apollo v8 for frame interpolation. +/// Supports up to 8x upscaling and 120 FPS output. Frame interpolation is automatically +/// enabled when target_fps is set. +pub fn video(params: VideoUpscaleRequest) -> FalRequest { + FalRequest::new("fal-ai/topaz/upscale/video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/transpixar/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/transpixar/mod.rs new file mode 100644 index 0000000000..03f17a2cc7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/transpixar/mod.rs @@ -0,0 +1,126 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// The target FPS of the video + #[serde(skip_serializing_if = "Option::is_none")] + pub export_fps: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related video to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The negative prompt to generate video from + /// "Distorted, discontinuous, Ugly, blurry, low resolution, motionless, static, disfigured, disconnected limbs, Ugly faces, incomplete arms" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate the video from. + /// "A cloud of dust erupting and dispersing like an explosion." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same video every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The prompt used for generating the video. + pub prompt: String, + /// Seed of the generated video. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, + /// The URL to the generated video + /// [{"content_type":"application/octet-stream","file_name":"rgb.mp4","file_size":146468,"url":"https://v3.fal.media/files/kangaroo/G6gkFsuyU5L7sJ55nZUPU_rgb.mp4"},{"content_type":"application/octet-stream","file_name":"alpha.mp4","file_size":106894,"url":"https://v3.fal.media/files/lion/g7PBZfQEH9SoPXYgeyl5P_alpha.mp4"}] + pub videos: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// TransPixar +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// TransPixar: Backgroundless video generation model +pub fn transpixar(params: BaseInput) -> FalRequest { + FalRequest::new("fal-ai/transpixar", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/trellis/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/trellis/mod.rs new file mode 100644 index 0000000000..03cbad0034 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/trellis/mod.rs @@ -0,0 +1,93 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputModel { + /// URL of the input image to convert to 3D + /// "https://storage.googleapis.com/falserverless/web-examples/rodin3d/warriorwoman.png" + pub image_url: String, + /// Mesh simplification factor + #[serde(skip_serializing_if = "Option::is_none")] + pub mesh_simplify: Option, + /// Random seed for reproducibility + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Guidance strength for structured latent generation + #[serde(skip_serializing_if = "Option::is_none")] + pub slat_guidance_strength: Option, + /// Sampling steps for structured latent generation + #[serde(skip_serializing_if = "Option::is_none")] + pub slat_sampling_steps: Option, + /// Guidance strength for sparse structure generation + #[serde(skip_serializing_if = "Option::is_none")] + pub ss_guidance_strength: Option, + /// Sampling steps for sparse structure generation + #[serde(skip_serializing_if = "Option::is_none")] + pub ss_sampling_steps: Option, + /// Texture resolution + #[serde(skip_serializing_if = "Option::is_none")] + pub texture_size: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D mesh file + pub model_mesh: File, + /// Processing timings + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Trellis +/// +/// Category: image-to-3d +/// Machine Type: A100 +/// License Type: commercial +pub fn trellis(params: InputModel) -> FalRequest { + FalRequest::new("fal-ai/trellis", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/mod.rs new file mode 100644 index 0000000000..2e5f1f8954 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/mod.rs @@ -0,0 +1,132 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_triposr" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_triposr" + ))) +)] +pub mod remeshing; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + pub model_mesh: File, + /// Directory containing textures for the remeshed model. + #[serde(skip_serializing_if = "Option::is_none")] + pub remeshing_dir: Option>, + /// Inference timings. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemeshingInput { + /// Number of faces for remesh + #[serde(skip_serializing_if = "Option::is_none")] + pub faces: Option, + /// Merge duplicate vertices before exporting + #[serde(skip_serializing_if = "Option::is_none")] + pub merge: Option, + /// Path for the object file to be remeshed. + /// "https://huggingface.co/fal-ai/resources/resolve/main/inputs/example_obj.glb" + pub object_url: String, + /// Output format for the 3D model. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Preserve UVs during remeshing + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_uvs: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TripoSRInput { + /// Whether to remove the background from the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub do_remove_background: Option, + /// Ratio of the foreground image to the original image. + #[serde(skip_serializing_if = "Option::is_none")] + pub foreground_ratio: Option, + /// Path for the image file to be processed. + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/hamburger.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/poly_fox.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/robot.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/teapot.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/tiger_girl.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/horse.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/flamingo.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/unicorn.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/chair.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/iso_house.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/marble.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/police_woman.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/captured_p.png" + pub image_url: String, + /// Resolution of the marching cubes. Above 512 is not recommended. + #[serde(skip_serializing_if = "Option::is_none")] + pub mc_resolution: Option, + /// Output format for the 3D model. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// TripoSR +/// +/// Category: image-to-3d +/// Machine Type: A6000 +pub fn triposr(params: TripoSRInput) -> FalRequest { + FalRequest::new("fal-ai/triposr", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/remeshing/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/remeshing/mod.rs new file mode 100644 index 0000000000..225f4e4976 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/triposr/remeshing/mod.rs @@ -0,0 +1,117 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ObjectOutput { + /// Generated 3D object file. + pub model_mesh: File, + /// Directory containing textures for the remeshed model. + #[serde(skip_serializing_if = "Option::is_none")] + pub remeshing_dir: Option>, + /// Inference timings. + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RemeshingInput { + /// Number of faces for remesh + #[serde(skip_serializing_if = "Option::is_none")] + pub faces: Option, + /// Merge duplicate vertices before exporting + #[serde(skip_serializing_if = "Option::is_none")] + pub merge: Option, + /// Path for the object file to be remeshed. + /// "https://huggingface.co/fal-ai/resources/resolve/main/inputs/example_obj.glb" + pub object_url: String, + /// Output format for the 3D model. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// Preserve UVs during remeshing + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_uvs: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TripoSRInput { + /// Whether to remove the background from the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub do_remove_background: Option, + /// Ratio of the foreground image to the original image. + #[serde(skip_serializing_if = "Option::is_none")] + pub foreground_ratio: Option, + /// Path for the image file to be processed. + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/hamburger.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/poly_fox.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/robot.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/teapot.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/tiger_girl.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/horse.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/flamingo.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/unicorn.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/chair.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/iso_house.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/marble.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/police_woman.png" + /// "https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/ea034e12a428fa848684a3f9f267b2042d298ca6/examples/captured_p.png" + pub image_url: String, + /// Resolution of the marching cubes. Above 512 is not recommended. + #[serde(skip_serializing_if = "Option::is_none")] + pub mc_resolution: Option, + /// Output format for the 3D model. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// TripoSR +/// +/// Category: image-to-3d +/// Machine Type: A6000 +pub fn remeshing(params: RemeshingInput) -> FalRequest { + FalRequest::new("fal-ai/triposr/remeshing", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/image_to_video/mod.rs new file mode 100644 index 0000000000..6fd00739b8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/image_to_video/mod.rs @@ -0,0 +1,114 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the input image to animate. Should be 720p or higher resolution. + /// "https://fal.media/files/elephant/6fq8JDSjb1osE_c3J_F2H.png" + pub image_url: String, + /// The text prompt describing how the image should be animated + /// "A lego chef cooking eggs" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/uNu-1qkbNt8be8iHA1hiB_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The text prompt describing the video you want to generate + /// "The camera floats gently through rows of pastel-painted wooden beehives, buzzing honeybees gliding in and out of frame. The motion settles on the refined farmer standing at the center, his pristine white beekeeping suit gleaming in the golden afternoon light. He lifts a jar of honey, tilting it slightly to catch the light. Behind him, tall sunflowers sway rhythmically in the breeze, their petals glowing in the warm sunlight. The camera tilts upward to reveal a retro farmhouse with mint-green shutters, its walls dappled with shadows from swaying trees. Shot with a 35mm lens on Kodak Portra 400 film, the golden light creates rich textures on the farmer's gloves, marmalade jar, and weathered wood of the beehives." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/tiger/83-YzufmOlsnhqq5ed382_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Veo 2 (Image to Video) +/// +/// Category: image-to-video +/// +/// +/// +/// Generate videos by animating an input image using Google's [Veo 2 model](https://blog.google/technology/google-labs/video-image-generation-update-december-2024/). +/// +/// The prompt should describe how to animate the input image. Include: +/// - Action: How the image should be animated +/// - Style: Desired animation style +/// - Camera motion (optional): How camera should move +/// - Ambiance (optional): Desired mood and atmosphere +/// +/// More details are available in our [prompting guide](https://blog.fal.ai/mastering-video-generation-with-veo-2-a-comprehensive-guide/). +/// +/// The model supports: +/// - Input images up to 8MB in size +/// - 720p output resolution +/// - Both 16:9 (landscape) and 9:16 (portrait) aspect ratios +/// - Natural motion and realistic animations +/// - Control over animation via text prompts +/// +/// Safety filters are applied to both input images and generated content. +pub fn image_to_video( + params: ImageToVideoInput, +) -> FalRequest { + FalRequest::new("fal-ai/veo2/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/mod.rs new file mode 100644 index 0000000000..0aced4c04d --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/veo2/mod.rs @@ -0,0 +1,128 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_veo2" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_veo2" + ))) +)] +pub mod image_to_video; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoInput { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// URL of the input image to animate. Should be 720p or higher resolution. + /// "https://fal.media/files/elephant/6fq8JDSjb1osE_c3J_F2H.png" + pub image_url: String, + /// The text prompt describing how the image should be animated + /// "A lego chef cooking eggs" + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/zebra/uNu-1qkbNt8be8iHA1hiB_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToVideoInput { + /// The aspect ratio of the generated video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The duration of the generated video in seconds + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// The text prompt describing the video you want to generate + /// "The camera floats gently through rows of pastel-painted wooden beehives, buzzing honeybees gliding in and out of frame. The motion settles on the refined farmer standing at the center, his pristine white beekeeping suit gleaming in the golden afternoon light. He lifts a jar of honey, tilting it slightly to catch the light. Behind him, tall sunflowers sway rhythmically in the breeze, their petals glowing in the warm sunlight. The camera tilts upward to reveal a retro farmhouse with mint-green shutters, its walls dappled with shadows from swaying trees. Shot with a 35mm lens on Kodak Portra 400 film, the golden light creates rich textures on the farmer's gloves, marmalade jar, and weathered wood of the beehives." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextToVideoOutput { + /// The generated video + /// {"url":"https://v3.fal.media/files/tiger/83-YzufmOlsnhqq5ed382_output.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Veo 2 (Image to Video) +/// +/// Category: image-to-video +/// +/// +/// +/// Generate videos using Google's [Veo 2 text-to-video model](https://blog.google/technology/google-labs/video-image-generation-update-december-2024/). +/// +/// For best results, prompts should be descriptive and clear. Include: +/// - Subject: What you want in the video (object, person, animal, scenery) +/// - Context: The background/setting +/// - Action: What the subject is doing +/// - Style: Film style keywords (horror, noir, cartoon etc.) +/// - Camera motion (optional): aerial view, tracking shot etc. +/// - Composition (optional): wide shot, close-up etc. +/// - Ambiance (optional): Color and lighting details +/// +/// More details are available in our [prompting guide](https://blog.fal.ai/mastering-video-generation-with-veo-2-a-comprehensive-guide/). +/// +/// The model supports: +/// - 720p resolution videos +/// - 5-8 second duration at 24 FPS +/// - Both 16:9 (landscape) and 9:16 (portrait) aspect ratios +/// +/// Safety filters prevent generation of inappropriate content. +pub fn veo2(params: TextToVideoInput) -> FalRequest { + FalRequest::new("fal-ai/veo2", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/video_prompt_generator/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/video_prompt_generator/mod.rs new file mode 100644 index 0000000000..171c077f87 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/video_prompt_generator/mod.rs @@ -0,0 +1,68 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InputModel { + /// Camera direction + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_direction: Option, + /// Camera movement style + #[serde(skip_serializing_if = "Option::is_none")] + pub camera_style: Option, + /// Custom technical elements (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_elements: Option, + /// URL of an image to analyze and incorporate into the video prompt (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url: Option, + /// Core concept or thematic input for the video prompt + /// "A futuristic city at dusk" + pub input_concept: String, + /// Model to use + #[serde(skip_serializing_if = "Option::is_none")] + pub model: Option, + /// Pacing rhythm + #[serde(skip_serializing_if = "Option::is_none")] + pub pacing: Option, + /// Length of the prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt_length: Option, + /// Special effects approach + #[serde(skip_serializing_if = "Option::is_none")] + pub special_effects: Option, + /// Style of the video prompt + #[serde(skip_serializing_if = "Option::is_none")] + pub style: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct OutputModel { + /// Generated video prompt + /// "A futuristic city glows softly at dusk, captured with smooth gimbal movements and a slow burn pacing, enhanced by subtle holographic overlays." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Video Prompt Generator +/// +/// Category: llm +pub fn video_prompt_generator(params: InputModel) -> FalRequest { + FalRequest::new("fal-ai/video-prompt-generator", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/video_upscaler/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/video_upscaler/mod.rs new file mode 100644 index 0000000000..4c99fd5b42 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/video_upscaler/mod.rs @@ -0,0 +1,66 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The scale factor + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, + /// The URL of the video to upscale + /// "https://storage.googleapis.com/falserverless/videos/_o3VmzjOytBwRjCVPFX6i_output.mp4" + pub video_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// The stitched video + /// {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/videos/h0jgPaO6AJAbyrsNYNbGl_upscaled_video.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Video Upscaler +/// +/// Category: video-to-video +/// Machine Type: A6000 +pub fn video_upscaler(params: Input) -> FalRequest { + FalRequest::new("fal-ai/video-upscaler", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/image_to_video/mod.rs new file mode 100644 index 0000000000..55a0d2d6a4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/image_to_video/mod.rs @@ -0,0 +1,153 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/stylish_woman.webp" + pub image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoOutput { + /// The generated video with consistent subjects from reference images + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/referencevideo.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "The little devil is looking at the apple on the beach and walking around it." + pub prompt: String, + /// URLs of the reference images to use for consistent subject appearance + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference3.png"] + pub reference_image_urls: Vec, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoOutput { + /// The generated transition video between start and end frames + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/2-car.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoRequest { + /// URL of the image to use as the last frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carbody.png" + pub end_image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "Transform the car frame into a complete vehicle." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carchasis.png" + pub start_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoOutput { + /// The generated video using a predefined template + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/hugging.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URLs of the images to use with the template. Number of images required varies by template: 'dynasty_dress' and 'shop_frame' accept 1-2 images, 'wish_sender' requires exactly 3 images, all other templates accept only 1 image. + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/hug.PNG"] + pub input_image_urls: Vec, + /// Text prompt for video generation, max 1500 characters + /// "Couple hugging each other" + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// AI video template to use. Pricing varies by template: Standard templates (hug, kiss, love_pose, etc.) cost 4 credits ($0.20), Premium templates (lunar_newyear, dynasty_dress, dreamy_wedding, etc.) cost 6 credits ($0.30), and Advanced templates (live_photo) cost 10 credits ($0.50). + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/gzfzC5FXvcgZegQmy90L1_output.mp4"} + pub video: File, +} + +/// Vidu Image to Video +/// +/// Category: image-to-video +/// +/// +/// +/// Vidu Image to Video API: Transform a single image into a dynamic video with motion. +pub fn image_to_video(params: ImageToVideoRequest) -> FalRequest { + FalRequest::new("fal-ai/vidu/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/mod.rs new file mode 100644 index 0000000000..85386c163a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/mod.rs @@ -0,0 +1,56 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" + ))) +)] +pub mod reference_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" + ))) +)] +pub mod start_end_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_vidu" + ))) +)] +pub mod template_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/reference_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/reference_to_video/mod.rs new file mode 100644 index 0000000000..7c3ce5e62f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/reference_to_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/stylish_woman.webp" + pub image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ReferenceToVideoOutput { + /// The generated video with consistent subjects from reference images + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/referencevideo.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "The little devil is looking at the apple on the beach and walking around it." + pub prompt: String, + /// URLs of the reference images to use for consistent subject appearance + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference3.png"] + pub reference_image_urls: Vec, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoOutput { + /// The generated transition video between start and end frames + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/2-car.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoRequest { + /// URL of the image to use as the last frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carbody.png" + pub end_image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "Transform the car frame into a complete vehicle." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carchasis.png" + pub start_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoOutput { + /// The generated video using a predefined template + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/hugging.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URLs of the images to use with the template. Number of images required varies by template: 'dynasty_dress' and 'shop_frame' accept 1-2 images, 'wish_sender' requires exactly 3 images, all other templates accept only 1 image. + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/hug.PNG"] + pub input_image_urls: Vec, + /// Text prompt for video generation, max 1500 characters + /// "Couple hugging each other" + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// AI video template to use. Pricing varies by template: Standard templates (hug, kiss, love_pose, etc.) cost 4 credits ($0.20), Premium templates (lunar_newyear, dynasty_dress, dreamy_wedding, etc.) cost 6 credits ($0.30), and Advanced templates (live_photo) cost 10 credits ($0.50). + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/gzfzC5FXvcgZegQmy90L1_output.mp4"} + pub video: File, +} + +/// Vidu Image to Video +/// +/// Category: image-to-video +/// +/// +/// +/// Vidu Reference to Video API: Generate a video with consistent subjects using reference images. +pub fn reference_to_video( + params: ReferenceToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/vidu/reference-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/start_end_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/start_end_to_video/mod.rs new file mode 100644 index 0000000000..8774ccdef3 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/start_end_to_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/stylish_woman.webp" + pub image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoOutput { + /// The generated video with consistent subjects from reference images + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/referencevideo.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "The little devil is looking at the apple on the beach and walking around it." + pub prompt: String, + /// URLs of the reference images to use for consistent subject appearance + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference3.png"] + pub reference_image_urls: Vec, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct StartEndToVideoOutput { + /// The generated transition video between start and end frames + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/2-car.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoRequest { + /// URL of the image to use as the last frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carbody.png" + pub end_image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "Transform the car frame into a complete vehicle." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carchasis.png" + pub start_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoOutput { + /// The generated video using a predefined template + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/hugging.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URLs of the images to use with the template. Number of images required varies by template: 'dynasty_dress' and 'shop_frame' accept 1-2 images, 'wish_sender' requires exactly 3 images, all other templates accept only 1 image. + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/hug.PNG"] + pub input_image_urls: Vec, + /// Text prompt for video generation, max 1500 characters + /// "Couple hugging each other" + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// AI video template to use. Pricing varies by template: Standard templates (hug, kiss, love_pose, etc.) cost 4 credits ($0.20), Premium templates (lunar_newyear, dynasty_dress, dreamy_wedding, etc.) cost 6 credits ($0.30), and Advanced templates (live_photo) cost 10 credits ($0.50). + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/gzfzC5FXvcgZegQmy90L1_output.mp4"} + pub video: File, +} + +/// Vidu Image to Video +/// +/// Category: image-to-video +/// +/// +/// +/// Vidu Start-End to Video API: Generate a smooth transition video between start and end frames. +pub fn start_end_to_video( + params: StartEndToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/vidu/start-end-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/template_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/template_to_video/mod.rs new file mode 100644 index 0000000000..9c989e6db1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/vidu/template_to_video/mod.rs @@ -0,0 +1,155 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToVideoRequest { + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/stylish_woman.webp" + pub image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoOutput { + /// The generated video with consistent subjects from reference images + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/referencevideo.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ReferenceToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "The little devil is looking at the apple on the beach and walking around it." + pub prompt: String, + /// URLs of the reference images to use for consistent subject appearance + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png","https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference3.png"] + pub reference_image_urls: Vec, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoOutput { + /// The generated transition video between start and end frames + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/2-car.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StartEndToVideoRequest { + /// URL of the image to use as the last frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carbody.png" + pub end_image_url: String, + /// The movement amplitude of objects in the frame + #[serde(skip_serializing_if = "Option::is_none")] + pub movement_amplitude: Option, + /// Text prompt for video generation, max 1500 characters + /// "Transform the car frame into a complete vehicle." + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// URL of the image to use as the first frame + /// "https://storage.googleapis.com/falserverless/web-examples/vidu/2-carchasis.png" + pub start_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TemplateToVideoOutput { + /// The generated video using a predefined template + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/vidu/hugging.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TemplateToVideoRequest { + /// The aspect ratio of the output video + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// URLs of the images to use with the template. Number of images required varies by template: 'dynasty_dress' and 'shop_frame' accept 1-2 images, 'wish_sender' requires exactly 3 images, all other templates accept only 1 image. + /// ["https://storage.googleapis.com/falserverless/web-examples/vidu/hug.PNG"] + pub input_image_urls: Vec, + /// Text prompt for video generation, max 1500 characters + /// "Couple hugging each other" + pub prompt: String, + /// Random seed for generation + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// AI video template to use. Pricing varies by template: Standard templates (hug, kiss, love_pose, etc.) cost 4 credits ($0.20), Premium templates (lunar_newyear, dynasty_dress, dreamy_wedding, etc.) cost 6 credits ($0.30), and Advanced templates (live_photo) cost 10 credits ($0.50). + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct VideoOutput { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/gzfzC5FXvcgZegQmy90L1_output.mp4"} + pub video: File, +} + +/// Vidu Image to Video +/// +/// Category: image-to-video +/// +/// +/// +/// Vidu Template to Video API: Generate a video using predefined templates. +pub fn template_to_video( + params: TemplateToVideoRequest, +) -> FalRequest { + FalRequest::new("fal-ai/vidu/template-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/mod.rs new file mode 100644 index 0000000000..35dcd5fcb5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" + ))) +)] +pub mod v2_1; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/mod.rs new file mode 100644 index 0000000000..3115e59453 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/mod.rs @@ -0,0 +1 @@ +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/text_to_video/mod.rs new file mode 100644 index 0000000000..bcabe570cf --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/1_3b/text_to_video/mod.rs @@ -0,0 +1,33 @@ +#[allow(unused_imports)] +use std::collections::HashMap; +#[allow(unused_imports)] +use serde::{Serialize, Deserialize}; +#[allow(unused_imports)] +use crate::prelude::*; + + + + #[derive(Debug, Serialize, Deserialize)] + pub struct WanT2VResponse { + /// The seed used for generation. +pub seed: i64, +/// The generated video file./// The generated video file./// {"url":"https://v3.fal.media/files/lion/mF2VjLzSNyI-KTAuDQExX_tmpvkubnfyc.mp4"} + +pub video: File + } + + + /// Wan-2.1 1.3B Text-to-Video +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// WAN 1.3B model for fast text-to-video generation. + pub fn text_to_video(params: WanT2VRequest) -> FalRequest { + FalRequest::new( + "fal-ai/wan/v2.1/1.3b/text-to-video", + params + ) + } + \ No newline at end of file diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/mod.rs new file mode 100644 index 0000000000..221927f976 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" + ))) +)] +pub mod v1_3b; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/mod.rs new file mode 100644 index 0000000000..2d7863838f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/text_to_video/mod.rs new file mode 100644 index 0000000000..01442e2c65 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan/v2_1/v1_3b/text_to_video/mod.rs @@ -0,0 +1,100 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanT2VRequest { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to enable prompt expansion. + /// false + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_expansion: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Classifier-free guidance scale. Controls prompt adherence vs. creativity + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The negative prompt to use. Use it to address details that you don't want + /// in the image. This could be colors, objects, scenery and even the small + /// details (e.g. moustache, blurry, low resolution). + /// "" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of inference steps for sampling. Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The text prompt to guide video generation. + /// "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage." + pub prompt: String, + /// The sampler to use for generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub sampler: Option, + /// Random seed for reproducibility. If None, a random seed is chosen. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Noise schedule shift parameter. Affects temporal dynamics. + #[serde(skip_serializing_if = "Option::is_none")] + pub shift: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanT2VResponse { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://v3.fal.media/files/lion/mF2VjLzSNyI-KTAuDQExX_tmpvkubnfyc.mp4"} + pub video: File, +} + +/// Wan-2.1 1.3B Text-to-Video +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// WAN 1.3B model for fast text-to-video generation. +pub fn text_to_video(params: WanT2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan/v2.1/1.3b/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_effects/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_effects/mod.rs new file mode 100644 index 0000000000..cf5f95431c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_effects/mod.rs @@ -0,0 +1,122 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BaseInput { + /// Aspect ratio of the output video. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// The type of effect to apply to the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub effect_type: Option, + /// Frames per second of the generated video. + #[serde(skip_serializing_if = "Option::is_none")] + pub frames_per_second: Option, + /// URL of the input image. + /// "https://storage.googleapis.com/falserverless/web-examples/wan-effects/cat.jpg" + /// "https://storage.googleapis.com/falserverless/web-examples/wan-effects/man_1.png" + /// "https://storage.googleapis.com/falserverless/web-examples/wan-effects/woman_2.png" + pub image_url: String, + /// The scale of the LoRA weight. Used to adjust effect intensity. + #[serde(skip_serializing_if = "Option::is_none")] + pub lora_scale: Option, + /// Number of frames to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// Number of inference steps for sampling. Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// Random seed for reproducibility. If None, a random seed is chosen. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The subject to insert into the predefined prompt template for the selected effect. + /// "a cute kitten" + /// "Donald Trump" + /// "a tank" + /// "a ceramic vase" + pub subject: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanEffectsOutput { + pub seed: i64, + /// The generated video + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/wan-effects/cat_video.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ContentTypeProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileNameProperty { + #[default] + String(String), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum FileSizeProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum SeedProperty { + #[default] + Integer(i64), + Null(serde_json::Value), +} + +/// Wan Effects +/// +/// Category: image-to-video +/// Machine Type: H100 +pub fn wan_effects(params: BaseInput) -> FalRequest { + FalRequest::new("fal-ai/wan-effects", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v/mod.rs new file mode 100644 index 0000000000..26da63ea81 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v/mod.rs @@ -0,0 +1,107 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanI2VRequest { + /// Aspect ratio of the generated video. If 'auto', the aspect ratio will be determined automatically based on the input image. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to enable prompt expansion. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_expansion: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Frames per second of the generated video. Must be between 5 to 24. + #[serde(skip_serializing_if = "Option::is_none")] + pub frames_per_second: Option, + /// Classifier-free guidance scale. Higher values give better adherence to the prompt but may decrease quality. + #[serde(skip_serializing_if = "Option::is_none")] + pub guide_scale: Option, + /// URL of the input image. + /// "https://storage.googleapis.com/falserverless/gallery/car_720p.png" + pub image_url: String, + /// Negative prompt for video generation. + /// "bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of frames to generate. Must be between 81 to 100 (inclusive). If the number of frames is greater than 81, the video will be generated with 1.25x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// Number of inference steps for sampling. Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The text prompt to guide video generation. + /// "Cars racing in slow motion" + pub prompt: String, + /// Resolution of the generated video (480p or 720p). 480p is 0.5 billing units, and 720p is 1 billing unit. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for reproducibility. If None, a random seed is chosen. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Shift parameter for video generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub shift: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanI2VResponse { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/gallery/wan-i2v-example.mp4"} + pub video: File, +} + +/// Wan-2.1 Image-to-Video +/// +/// Category: image-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from an image and prompt. +pub fn wan_i2v(params: WanI2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan-i2v", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v_lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v_lora/mod.rs new file mode 100644 index 0000000000..54e9f5bae2 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_i2v_lora/mod.rs @@ -0,0 +1,113 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanLoRAI2VRequest { + /// Aspect ratio of the output video. + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to enable prompt expansion. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_expansion: Option, + /// Frames per second of the generated video. Must be between 5 to 24. + #[serde(skip_serializing_if = "Option::is_none")] + pub frames_per_second: Option, + /// Classifier-free guidance scale. Higher values give better adherence to the prompt but may decrease quality. + #[serde(skip_serializing_if = "Option::is_none")] + pub guide_scale: Option, + /// URL of the input image. + /// "https://storage.googleapis.com/falserverless/gallery/car_720p.png" + pub image_url: String, + /// LoRA weights to be used in the inference. + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// Negative prompt for video generation. + /// "bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of frames to generate. Must be between 81 to 100 (inclusive). If the number of frames is greater than 81, the video will be generated with 1.25x more billing units. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// Number of inference steps for sampling. Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The text prompt to guide video generation. + /// "Cars race in slow motion." + pub prompt: String, + /// If true, the video will be reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_video: Option, + /// Random seed for reproducibility. If None, a random seed is chosen. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Shift parameter for video generation. + #[serde(skip_serializing_if = "Option::is_none")] + pub shift: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanT2VResponse { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: File, +} + +/// Wan-2.1 Image-to-Video with LoRAs +/// +/// Category: image-to-video +/// Machine Type: H100 +pub fn wan_i2v_lora(params: WanLoRAI2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan-i2v-lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/image_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/image_to_video/mod.rs new file mode 100644 index 0000000000..b9ce32e04c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/image_to_video/mod.rs @@ -0,0 +1,89 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProI2VRequest { + /// Whether to enable the safety checker + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The URL of the image to generate the video from + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// The prompt to generate the video + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanProI2VResponse { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/K1hB3k-IXBzq9rz1kNOxy.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProT2VRequest { + /// Whether to enable the safety checker + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The prompt to generate the video + /// "A lone astronaut in a detailed NASA spacesuit performs an exuberant dance on the lunar surface, arms outstretched in joyful abandon against the stark moonscape. The Earth hangs dramatically in the black sky, appearing to streak past due to the motion of the dance, creating a sense of dynamic movement. The scene captures extreme contrasts between the brilliant white of the spacesuit reflecting harsh sunlight and the deep shadows of the lunar craters. Every detail is rendered with photorealistic precision: the texture of the regolith disturbed by the astronaut's boots, the reflections on the helmet visor." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProT2VResponse { + /// The generated video + /// {"url":"https://fal.media/files/panda/YxRLson-aETxeBK1DI4VW.mp4"} + pub video: File, +} + +/// Wan-2.1 Pro Image-to-Video +/// +/// Category: image-to-video +/// Machine Type: H100 +/// +/// +/// Generate a 6-second 1080p video (at 30 FPS) from an image and text using an enhanced version of Wan 2.1. +pub fn image_to_video(params: WanProI2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan-pro/image-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/mod.rs new file mode 100644 index 0000000000..99cf4d9617 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/mod.rs @@ -0,0 +1,28 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" + ))) +)] +pub mod image_to_video; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_wan-pro" + ))) +)] +pub mod text_to_video; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/text_to_video/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/text_to_video/mod.rs new file mode 100644 index 0000000000..c199d6adc7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_pro/text_to_video/mod.rs @@ -0,0 +1,89 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProI2VRequest { + /// Whether to enable the safety checker + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The URL of the image to generate the video from + /// "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg" + pub image_url: String, + /// The prompt to generate the video + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProI2VResponse { + /// The generated video + /// {"url":"https://fal.media/files/kangaroo/K1hB3k-IXBzq9rz1kNOxy.mp4"} + pub video: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanProT2VRequest { + /// Whether to enable the safety checker + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The prompt to generate the video + /// "A lone astronaut in a detailed NASA spacesuit performs an exuberant dance on the lunar surface, arms outstretched in joyful abandon against the stark moonscape. The Earth hangs dramatically in the black sky, appearing to streak past due to the motion of the dance, creating a sense of dynamic movement. The scene captures extreme contrasts between the brilliant white of the spacesuit reflecting harsh sunlight and the deep shadows of the lunar craters. Every detail is rendered with photorealistic precision: the texture of the regolith disturbed by the astronaut's boots, the reflections on the helmet visor." + pub prompt: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanProT2VResponse { + /// The generated video + /// {"url":"https://fal.media/files/panda/YxRLson-aETxeBK1DI4VW.mp4"} + pub video: File, +} + +/// Wan-2.1 Pro Image-to-Video +/// +/// Category: image-to-video +/// Machine Type: H100 +/// +/// +/// Generate a 6-second 1080p video (at 30 FPS) from text using an enhanced version of Wan 2.1. +pub fn text_to_video(params: WanProT2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan-pro/text-to-video", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_t2v/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_t2v/mod.rs new file mode 100644 index 0000000000..3a5f2a2b0c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_t2v/mod.rs @@ -0,0 +1,98 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WanT2VRequest { + /// Aspect ratio of the generated video (16:9 or 9:16). + #[serde(skip_serializing_if = "Option::is_none")] + pub aspect_ratio: Option, + /// Whether to enable prompt expansion. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_prompt_expansion: Option, + /// If set to true, the safety checker will be enabled. + /// true + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// Frames per second of the generated video. Must be between 5 to 24. + #[serde(skip_serializing_if = "Option::is_none")] + pub frames_per_second: Option, + /// Negative prompt for video generation. + /// "bright colors, overexposed, static, blurred details, subtitles, style, artwork, painting, picture, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, malformed limbs, fused fingers, still picture, cluttered background, three legs, many people in the background, walking backwards" + #[serde(skip_serializing_if = "Option::is_none")] + pub negative_prompt: Option, + /// Number of frames to generate. Must be between 81 to 100 (inclusive). + #[serde(skip_serializing_if = "Option::is_none")] + pub num_frames: Option, + /// Number of inference steps for sampling. Higher values give better quality but take longer. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The text prompt to guide video generation. + /// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse." + pub prompt: String, + /// Resolution of the generated video (480p,580p, or 720p). + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// Random seed for reproducibility. If None, a random seed is chosen. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WanT2VResponse { + /// The seed used for generation. + pub seed: i64, + /// The generated video file. + /// {"url":"https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4"} + pub video: File, +} + +/// Wan-2.1 Text-to-Video +/// +/// Category: text-to-video +/// Machine Type: H100 +/// +/// +/// Generate a video from a prompt. +pub fn wan_t2v(params: WanT2VRequest) -> FalRequest { + FalRequest::new("fal-ai/wan-t2v", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_trainer/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_trainer/mod.rs new file mode 100644 index 0000000000..9985566070 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wan_trainer/mod.rs @@ -0,0 +1,71 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// The rate at which the model learns. Higher values can lead to faster training, but over-fitting. + #[serde(skip_serializing_if = "Option::is_none")] + pub learning_rate: Option, + /// The number of steps to train for. + #[serde(skip_serializing_if = "Option::is_none")] + pub number_of_steps: Option, + /// URL to zip archive with images of a consistent style. Try to use at least 10 images and/or videos, although more is better. + /// + /// In addition to images the archive can contain text files with captions. Each text file should have the same name as the image/video file it corresponds to. + pub training_data_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Configuration used for setting up the inference endpoints. + pub config_file: File, + /// URL to the trained LoRA weights. + pub lora_file: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Wan-2.1 LoRA Trainer +/// +/// Category: training +/// Machine Type: H100 +pub fn wan_trainer(params: Input) -> FalRequest { + FalRequest::new("fal-ai/wan-trainer", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/whisper/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/whisper/mod.rs new file mode 100644 index 0000000000..b042d26751 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/whisper/mod.rs @@ -0,0 +1,97 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DiarizationSegment { + /// Speaker ID of the segment + pub speaker: String, + /// Start and end timestamp of the segment + pub timestamp: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WhisperChunk { + /// Speaker ID of the chunk. Only present if diarization is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub speaker: Option, + /// Transcription of the chunk + pub text: String, + /// Start and end timestamp of the chunk + pub timestamp: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WhisperInput { + /// URL of the audio file to transcribe. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav or webm. + /// "https://storage.googleapis.com/falserverless/model_tests/whisper/dinner_conversation.mp3" + pub audio_url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub batch_size: Option, + /// Level of the chunks to return. Either segment or word. + #[serde(skip_serializing_if = "Option::is_none")] + pub chunk_level: Option, + /// Whether to diarize the audio file. Defaults to false. + #[serde(skip_serializing_if = "Option::is_none")] + pub diarize: Option, + /// Language of the audio file. If set to null, the language will be + /// automatically detected. Defaults to null. + /// + /// If translate is selected as the task, the audio will be translated to + /// English, regardless of the language selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub language: Option, + /// Number of speakers in the audio file. Defaults to null. + /// If not provided, the number of speakers will be automatically + /// detected. + /// null + #[serde(skip_serializing_if = "Option::is_none")] + pub num_speakers: Option, + /// Prompt to use for generation. Defaults to an empty string. + #[serde(skip_serializing_if = "Option::is_none")] + pub prompt: Option, + /// Task to perform on the audio file. Either transcribe or translate. + #[serde(skip_serializing_if = "Option::is_none")] + pub task: Option, + /// Version of the model to use. All of the models are the Whisper large variant. + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WhisperOutput { + /// Timestamp chunks of the audio file + #[serde(skip_serializing_if = "Option::is_none")] + pub chunks: Option>>, + /// Speaker diarization segments of the audio file. Only present if diarization is enabled. + pub diarization_segments: Vec, + /// List of languages that the audio file is inferred to be. Defaults to null. + pub inferred_languages: Vec, + /// Transcription of the audio file + pub text: String, +} + +/// Whisper +/// +/// Category: speech-to-text +/// Machine Type: A100 +pub fn whisper(params: WhisperInput) -> FalRequest { + FalRequest::new("fal-ai/whisper", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/wizper/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/wizper/mod.rs new file mode 100644 index 0000000000..284d1a1554 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/wizper/mod.rs @@ -0,0 +1,68 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WhisperChunk { + /// Transcription of the chunk + pub text: String, + /// Start and end timestamp of the chunk + pub timestamp: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct WhisperInput { + /// URL of the audio file to transcribe. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav or webm. + /// "https://ihlhivqvotguuqycfcvj.supabase.co/storage/v1/object/public/public-text-to-speech/scratch-testing/earth-history-19mins.mp3" + pub audio_url: String, + /// Level of the chunks to return. + #[serde(skip_serializing_if = "Option::is_none")] + pub chunk_level: Option, + /// Language of the audio file. + /// If translate is selected as the task, the audio will be translated to + /// English, regardless of the language selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub language: Option, + /// Task to perform on the audio file. Either transcribe or translate. + #[serde(skip_serializing_if = "Option::is_none")] + pub task: Option, + /// Version of the model to use. All of the models are the Whisper large variant. + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct WhisperOutput { + /// Timestamp chunks of the audio file + pub chunks: Vec, + /// Transcription of the audio file + pub text: String, +} + +/// Wizper (Whisper v3 -- fal.ai edition) +/// +/// Category: speech-to-text +/// Machine Type: A100 +/// +/// +/// Transcribe an audio file using the Whisper model. +pub fn wizper(params: WhisperInput) -> FalRequest { + FalRequest::new("fal-ai/wizper", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/blur_mask/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/blur_mask/mod.rs new file mode 100644 index 0000000000..b0047e3f4f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/blur_mask/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn blur_mask(params: BlurMaskInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/blur-mask", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/canny/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/canny/mod.rs new file mode 100644 index 0000000000..c98e73d650 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/canny/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn canny(params: CannyInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/canny", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/compare_text/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/compare_text/mod.rs new file mode 100644 index 0000000000..4c5d94d4e7 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/compare_text/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn compare_text(params: CompareTextInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/compare-text", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/composite_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/composite_image/mod.rs new file mode 100644 index 0000000000..c6f4b5882c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/composite_image/mod.rs @@ -0,0 +1,438 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn composite_image( + params: CompositeImageInput, +) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/composite-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/grow_mask/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/grow_mask/mod.rs new file mode 100644 index 0000000000..f0300fdcbb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/grow_mask/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn grow_mask(params: GrowMaskInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/grow-mask", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/image_size/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/image_size/mod.rs new file mode 100644 index 0000000000..2bd0db771e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/image_size/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn image_size(params: ImageInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/image-size", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insert_text/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insert_text/mod.rs new file mode 100644 index 0000000000..402189b5e8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insert_text/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn insert_text(params: InsertTextInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/insert-text", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insightface/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insightface/mod.rs new file mode 100644 index 0000000000..16b9ee0197 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/insightface/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn insightface(params: InsightfaceInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/insightface", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/invert_mask/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/invert_mask/mod.rs new file mode 100644 index 0000000000..3736074fb4 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/invert_mask/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn invert_mask(params: MaskInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/invert-mask", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/mod.rs new file mode 100644 index 0000000000..2f38f9bdec --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/mod.rs @@ -0,0 +1,224 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod blur_mask; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod canny; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod compare_text; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod composite_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod grow_mask; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod image_size; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod insert_text; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod insightface; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod invert_mask; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod regex_replace; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod resize_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod resize_to_max_pixels; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod rgba_to_rgb; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod shrink_mask; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod teed; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_workflowutils" + ))) +)] +pub mod transparent_image_to_mask; diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/regex_replace/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/regex_replace/mod.rs new file mode 100644 index 0000000000..25ecd79f93 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/regex_replace/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn regex_replace(params: RegexReplaceInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/regex-replace", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_image/mod.rs new file mode 100644 index 0000000000..d98814693c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_image/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn resize_image(params: ResizeImageInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/resize-image", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_to_max_pixels/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_to_max_pixels/mod.rs new file mode 100644 index 0000000000..2ff8346d63 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/resize_to_max_pixels/mod.rs @@ -0,0 +1,438 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn resize_to_max_pixels( + params: ResizeToPixelsInput, +) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/resize-to-max-pixels", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/rgba_to_rgb/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/rgba_to_rgb/mod.rs new file mode 100644 index 0000000000..c37cf1b379 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/rgba_to_rgb/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn rgba_to_rgb(params: RGBAToRGBImageInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/rgba-to-rgb", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/shrink_mask/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/shrink_mask/mod.rs new file mode 100644 index 0000000000..a6db29a923 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/shrink_mask/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn shrink_mask(params: ShrinkMaskInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/shrink-mask", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/teed/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/teed/mod.rs new file mode 100644 index 0000000000..bc5daf4b1a --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/teed/mod.rs @@ -0,0 +1,436 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn teed(params: TeedInput) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/teed", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/transparent_image_to_mask/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/transparent_image_to_mask/mod.rs new file mode 100644 index 0000000000..3836d07fae --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/workflowutils/transparent_image_to_mask/mod.rs @@ -0,0 +1,438 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The radius of the Gaussian blur. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub radius: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BlurMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/blur_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CannyInput { + /// High threshold for the hysteresis procedure + /// 200 + #[serde(skip_serializing_if = "Option::is_none")] + pub high_threshold: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Low threshold for the hysteresis procedure + /// 100 + #[serde(skip_serializing_if = "Option::is_none")] + pub low_threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Color { + /// Blue value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub b: Option, + /// Green value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub g: Option, + /// Red value + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub r: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompareTextInput { + /// Text to compare against + /// "Hello, World!" + pub compare_text: String, + /// Text to return if the input text does not match the compare text + /// "Hello, Universe!" + pub fail_text: String, + /// Text to return if the input text matches the compare text + /// "Hello, World!" + pub return_text: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CompositeImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub background_image_url: String, + /// Optional mask image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub mask_image_url: Option, + /// Overlay image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub overlay_image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct FaceDetection { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to grow the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GrowMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/grow_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageOutput { + /// The output image + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSizeOutput { + /// Image size + /// {"height":700,"width":610} + pub image_size: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsertTextInput { + /// Template to insert text into + /// "Hello, {}!" + pub template: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceInput { + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_height: Option, + /// Size of the detection. + /// 640 + #[serde(skip_serializing_if = "Option::is_none")] + pub det_size_width: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of faces to detect. + /// 1 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_face_num: Option, + /// URL of the model weights. + /// "buffalo_l" + /// "antelopev2" + #[serde(skip_serializing_if = "Option::is_none")] + pub model_url: Option, + /// Sorting of the faces. + /// "largest-to-smallest" + /// "smallest-to-largest" + /// "left-to-right" + /// "right-to-left" + #[serde(skip_serializing_if = "Option::is_none")] + pub sorting: Option, + /// Whether to run in sync mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, + /// Threshold for the edge map. + /// 0.5 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InsightfaceOutput { + /// Bounding box of the face. + /// [0,0,100,100] + pub bbox: Vec, + /// Confidence score of the detection. + /// 0.9 + pub det_score: f64, + /// Embedding of the face. + /// "" + pub embedding_file: File, + /// faces detected sorted by size + pub faces: Vec, + /// Keypoints of the face. + + #[serde(skip_serializing_if = "Option::is_none")] + pub kps: Option>>>>, + /// Keypoints of the face on the image. + pub kps_image: Image, + /// Either M or F if available. + /// "M" + #[serde(skip_serializing_if = "Option::is_none")] + pub sex: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InvertMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/invert_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RGBAToRGBImageInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Color to replace the transparent pixels with + /// {"b":128,"g":128,"r":128} + pub transparent_color: Color, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct RegexReplaceInput { + /// Pattern to replace + /// "World" + pub pattern: String, + /// Replacement text + /// "Universe" + pub replace: String, + /// Input text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeImageInput { + /// Position of cropping. Only used when mode is 'crop', default is center + #[serde(skip_serializing_if = "Option::is_none")] + pub cropping_position: Option, + /// Height of the resized image + /// 700 + pub height: i64, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// Resizing mode + pub mode: String, + /// Color of padding. Only used when mode is 'pad', default is black + #[serde(skip_serializing_if = "Option::is_none")] + pub padding_color: Option, + /// Resizing strategy. Only used when mode is 'scale', default is nearest + #[serde(skip_serializing_if = "Option::is_none")] + pub resampling: Option, + /// Proportions of the image. Only used when mode is 'scale', default is fit + #[serde(skip_serializing_if = "Option::is_none")] + pub scaling_proportions: Option, + /// Width of the resized image + /// 610 + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ResizeToPixelsInput { + /// If set, the output dimensions will be divisible by this value. + /// 32 + #[serde(skip_serializing_if = "Option::is_none")] + pub enforce_divisibility: Option, + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, + /// Maximum number of pixels in the output image. + /// 1000000 + #[serde(skip_serializing_if = "Option::is_none")] + pub max_pixels: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/mask_input.png" + pub image_url: String, + /// The number of pixels to shrink the mask. + /// 5 + #[serde(skip_serializing_if = "Option::is_none")] + pub pixels: Option, + /// The threshold to convert the image to a mask. 0-255. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ShrinkMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/shrink_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/retoucher/GGsAolHXsAA58vn.jpeg" + pub image_url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TeedOutput { + /// The edge map. + /// {"content_type":"image/png","height":2048,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/teed_output.png","width":1246} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextOutput { + /// The output text + /// "Hello, World!" + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TransparentImageToMaskInput { + /// Input image url. + /// "https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_input.png" + pub image_url: String, + /// The threshold to convert the image to a mask. + /// 128 + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct TransparentImageToMaskOutput { + /// The mask + /// {"content_type":"image/png","height":700,"url":"https://storage.googleapis.com/falserverless/model_tests/workflow_utils/transparent_image_to_mask_output.png","width":610} + pub image: Image, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// Image Preprocessors +/// +/// Category: image-to-image +/// Machine Type: A6000 +pub fn transparent_image_to_mask( + params: TransparentImageToMaskInput, +) -> FalRequest { + FalRequest::new("fal-ai/workflowutils/transparent-image-to-mask", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/yue/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/yue/mod.rs new file mode 100644 index 0000000000..2ab38db258 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/yue/mod.rs @@ -0,0 +1,68 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Generated music file. + /// {"content_type":"application/octet-stream","file_name":"cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0@93_T1@0_rp1@2_maxtk3000_mixed_8179e8da-5452-4cf6-9d6b-f69280feb7e8.mp3","file_size":480462,"url":"https://v3.fal.media/files/tiger/iAXHU3LtbJGeqPYWKkYMr_cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0%4093_T1%400_rp1%402_maxtk3000_mixed_74bcf408-eb99-4b88-b7bf-7d7212200cf1.mp3"} + pub audio: File, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToMusicInput { + /// The genres (separated by a space ' ') to guide the music generation. + /// "inspiring female uplifting pop airy vocal electronic bright vocal vocal" + /// "R&B male hiphop pop 80s vocal electronic dark vocal vocal" + pub genres: String, + /// The prompt to generate an image from. Must have two sections. Sections start with either [chorus] or a [verse]. + /// "[verse]\nStaring at the sunset, colors paint the sky\nThoughts of you keep swirling, can't deny\nI know I let you down, I made mistakes\nBut I'm here to mend the heart I didn't break\n\n[chorus]\nEvery road you take, I'll be one step behind\nEvery dream you chase, I'm reaching for the light\nYou can't fight this feeling now\nI won't back down\nYou know you can't deny it now\nI won't back down\n" + pub lyrics: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// YuE: Lyrics to Song +/// +/// Category: text-to-audio +/// +/// License Type: commercial +pub fn yue(params: TextToMusicInput) -> FalRequest { + FalRequest::new("fal-ai/yue", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fal_ai/zonos/mod.rs b/crates/vendor/fal-rs/src/endpoints/fal_ai/zonos/mod.rs new file mode 100644 index 0000000000..b797efe93f --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fal_ai/zonos/mod.rs @@ -0,0 +1,65 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct File { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The URL where the file can be downloaded from. + pub url: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ZonosInput { + /// The content generated using cloned voice. + /// "Fal is the fastest solution for your image generation." + pub prompt: String, + /// The reference audio. + /// "https://storage.googleapis.com/falserverless/model_tests/zonos/demo_voice_zonos.wav" + pub reference_audio_url: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ZonosOutput { + /// The generated audio + pub audio: File, +} + +/// Zonos-Audio-Clone +/// +/// Category: text-to-audio +/// Machine Type: A100 +pub fn zonos(params: ZonosInput) -> FalRequest { + FalRequest::new("fal-ai/zonos", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/fashn/mod.rs b/crates/vendor/fal-rs/src/endpoints/fashn/mod.rs new file mode 100644 index 0000000000..2913f5a248 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fashn/mod.rs @@ -0,0 +1,14 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fashn", + feature = "endpoints_fashn_tryon" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fashn", + feature = "endpoints_fashn_tryon" + ))) +)] +pub mod tryon; diff --git a/crates/vendor/fal-rs/src/endpoints/fashn/tryon/mod.rs b/crates/vendor/fal-rs/src/endpoints/fashn/tryon/mod.rs new file mode 100644 index 0000000000..dea1ccb27c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/fashn/tryon/mod.rs @@ -0,0 +1,109 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + /// The mime type of the file. + /// "image/png" + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + /// File data + #[serde(skip_serializing_if = "Option::is_none")] + pub file_data: Option, + /// The name of the file. It will be auto-generated if not provided. + /// "z9RV14K95DvU.png" + #[serde(skip_serializing_if = "Option::is_none")] + pub file_name: Option, + /// The size of the file in bytes. + /// 4404019 + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size: Option, + /// The height of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The URL where the file can be downloaded from. + pub url: String, + /// The width of the image in pixels. + /// 1024 + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Input { + /// Allow to change the appearance of the model’s hands. Example use-cases: Remove gloves, get hands out of pockets, long sleeves that should cover hands. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjust_hands: Option, + /// Category of the garment to try-on. + pub category: String, + /// Allows long garments to cover the feet/shoes or change their appearance. + #[serde(skip_serializing_if = "Option::is_none")] + pub cover_feet: Option, + /// URL or base64 of the garment image + /// "https://utfs.io/f/wXFHUNfTHmLjtkhepmqOUnkr8XxZbNIFmRWldShDLu320TeC" + pub garment_image: String, + /// Specifies the type of garment photo to optimize internal parameters for better performance. 'model' is for photos of garments on a model, 'flat-lay' is for flat-lay or ghost mannequin images, and 'auto' attempts to automatically detect the photo type. + #[serde(skip_serializing_if = "Option::is_none")] + pub garment_photo_type: Option, + /// Higher guidance scales can help with preserving garment detail, but risks oversaturated colors. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// Adjusts internal parameters for better performance on long tops such as: Longline shirts, tunics, coats, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub long_top: Option, + /// URL or base64 of the model image + /// "https://utfs.io/f/wXFHUNfTHmLj4prvqbRMQ6JXFyUr3IT0avK2HSOmZWiAsxg9" + pub model_image: String, + /// Runs NSFW content filter on inputs. + #[serde(skip_serializing_if = "Option::is_none")] + pub nsfw_filter: Option, + /// Number of images to generate in a single run. Image generation has a random element in it, so trying multiple images at once increases the chances of getting a good result. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_samples: Option, + /// Apply additional steps to preserve the original background. Runtime will be slower. Not needed for simple backgrounds. + #[serde(skip_serializing_if = "Option::is_none")] + pub restore_background: Option, + /// Apply additional steps to preserve the appearance of clothes that weren’t swapped (e.g. keep pants if trying-on top). + #[serde(skip_serializing_if = "Option::is_none")] + pub restore_clothes: Option, + /// Sets random operations to a fixed state. Use the same seed to reproduce results with the same inputs, or different seed to force different results. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// Determines how many steps the diffusion model will take to generate the image. For simple try-ons, steps can be reduced for faster runtime. + #[serde(skip_serializing_if = "Option::is_none")] + pub timesteps: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// URLs of the generated images + pub images: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +/// FASHN Virtual Try-On +/// +/// Category: image-to-image +/// Machine Type: H100 +/// License Type: commercial +pub fn tryon(params: Input) -> FalRequest { + FalRequest::new("fashn/tryon", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/mod.rs b/crates/vendor/fal-rs/src/endpoints/mod.rs new file mode 100644 index 0000000000..69564710fb --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/mod.rs @@ -0,0 +1,394 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_easel-ai", + feature = "endpoints_easel-ai_advanced-face-swap" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_easel-ai", + feature = "endpoints_easel-ai_advanced-face-swap" + ))) +)] +pub mod easel_ai; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync", + feature = "endpoints_fal-ai_veo2", + feature = "endpoints_fal-ai_minimax-music", + feature = "endpoints_fal-ai_diffrhythm", + feature = "endpoints_fal-ai_yue", + feature = "endpoints_fal-ai_flux-pro", + feature = "endpoints_fal-ai_ideogram", + feature = "endpoints_fal-ai_hunyuan-video-lora-training", + feature = "endpoints_fal-ai_flux-lora-fast-training", + feature = "endpoints_fal-ai_flux-lora-portrait-trainer", + feature = "endpoints_fal-ai_flux-pro-trainer", + feature = "endpoints_fal-ai_recraft-v3", + feature = "endpoints_fal-ai_minimax", + feature = "endpoints_fal-ai_minimax-image", + feature = "endpoints_fal-ai_hyper3d", + feature = "endpoints_fal-ai_aura-flow", + feature = "endpoints_fal-ai_flux", + feature = "endpoints_fal-ai_flux-lora", + feature = "endpoints_fal-ai_flux-subject", + feature = "endpoints_fal-ai_flux-lora-canny", + feature = "endpoints_fal-ai_flux-lora-depth", + feature = "endpoints_fal-ai_sana", + feature = "endpoints_fal-ai_omnigen-v1", + feature = "endpoints_fal-ai_lumina-image", + feature = "endpoints_fal-ai_stable-diffusion-v35-large", + feature = "endpoints_fal-ai_stable-diffusion-v35-medium", + feature = "endpoints_fal-ai_switti", + feature = "endpoints_fal-ai_recraft-20b", + feature = "endpoints_fal-ai_bria", + feature = "endpoints_fal-ai_flux-lora-fill", + feature = "endpoints_fal-ai_flux-control-lora-canny", + feature = "endpoints_fal-ai_flux-control-lora-depth", + feature = "endpoints_fal-ai_flux-general", + feature = "endpoints_fal-ai_flux-pulid", + feature = "endpoints_fal-ai_iclight-v2", + feature = "endpoints_fal-ai_flux-differential-diffusion", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium", + feature = "endpoints_fal-ai_fast-sdxl", + feature = "endpoints_fal-ai_lora", + feature = "endpoints_fal-ai_aura-sr", + feature = "endpoints_fal-ai_codeformer", + feature = "endpoints_fal-ai_thera", + feature = "endpoints_fal-ai_ddcolor", + feature = "endpoints_fal-ai_swin2sr", + feature = "endpoints_fal-ai_mix-dehaze-net", + feature = "endpoints_fal-ai_docres", + feature = "endpoints_fal-ai_nafnet", + feature = "endpoints_fal-ai_drct-super-resolution", + feature = "endpoints_fal-ai_ben", + feature = "endpoints_fal-ai_flowedit", + feature = "endpoints_fal-ai_zonos", + feature = "endpoints_fal-ai_stable-cascade", + feature = "endpoints_fal-ai_mochi-v1", + feature = "endpoints_fal-ai_stepfun-video", + feature = "endpoints_fal-ai_hunyuan-video", + feature = "endpoints_fal-ai_hunyuan-video-image-to-video", + feature = "endpoints_fal-ai_hunyuan-video-img2vid-lora", + feature = "endpoints_fal-ai_hunyuan-video-lora", + feature = "endpoints_fal-ai_wan", + feature = "endpoints_fal-ai_wan-t2v", + feature = "endpoints_fal-ai_wan-i2v", + feature = "endpoints_fal-ai_wan-i2v-lora", + feature = "endpoints_fal-ai_wan-trainer", + feature = "endpoints_fal-ai_wan-pro", + feature = "endpoints_fal-ai_wan-effects", + feature = "endpoints_fal-ai_skyreels-i2v", + feature = "endpoints_fal-ai_vidu", + feature = "endpoints_fal-ai_video-upscaler", + feature = "endpoints_fal-ai_auto-caption", + feature = "endpoints_fal-ai_mmaudio-v2", + feature = "endpoints_fal-ai_luma-dream-machine", + feature = "endpoints_fal-ai_luma-photon", + feature = "endpoints_fal-ai_kling", + feature = "endpoints_fal-ai_kling-video", + feature = "endpoints_fal-ai_pixverse", + feature = "endpoints_fal-ai_transpixar", + feature = "endpoints_fal-ai_cogvideox-5b", + feature = "endpoints_fal-ai_cogview4", + feature = "endpoints_fal-ai_ltx-video", + feature = "endpoints_fal-ai_ltx-video-v095", + feature = "endpoints_fal-ai_stable-video", + feature = "endpoints_fal-ai_fast-svd", + feature = "endpoints_fal-ai_fast-svd-lcm", + feature = "endpoints_fal-ai_birefnet", + feature = "endpoints_fal-ai_got-ocr", + feature = "endpoints_fal-ai_creative-upscaler", + feature = "endpoints_fal-ai_ffmpeg-api", + feature = "endpoints_fal-ai_clarity-upscaler", + feature = "endpoints_fal-ai_ccsr", + feature = "endpoints_fal-ai_fast-turbo-diffusion", + feature = "endpoints_fal-ai_fast-lcm-diffusion", + feature = "endpoints_fal-ai_whisper", + feature = "endpoints_fal-ai_wizper", + feature = "endpoints_fal-ai_fast-lightning-sdxl", + feature = "endpoints_fal-ai_hyper-sdxl", + feature = "endpoints_fal-ai_playground-v25", + feature = "endpoints_fal-ai_amt-interpolation", + feature = "endpoints_fal-ai_t2v-turbo", + feature = "endpoints_fal-ai_sd15-depth-controlnet", + feature = "endpoints_fal-ai_photomaker", + feature = "endpoints_fal-ai_lcm", + feature = "endpoints_fal-ai_lcm-sd15-i2i", + feature = "endpoints_fal-ai_fooocus", + feature = "endpoints_fal-ai_animatediff-v2v", + feature = "endpoints_fal-ai_fast-animatediff", + feature = "endpoints_fal-ai_illusion-diffusion", + feature = "endpoints_fal-ai_imageutils", + feature = "endpoints_fal-ai_esrgan", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny", + feature = "endpoints_fal-ai_inpaint", + feature = "endpoints_fal-ai_animatediff-sparsectrl-lcm", + feature = "endpoints_fal-ai_pulid", + feature = "endpoints_fal-ai_ip-adapter-face-id", + feature = "endpoints_fal-ai_stable-audio", + feature = "endpoints_fal-ai_diffusion-edge", + feature = "endpoints_fal-ai_triposr", + feature = "endpoints_fal-ai_retoucher", + feature = "endpoints_fal-ai_any-llm", + feature = "endpoints_fal-ai_llavav15-13b", + feature = "endpoints_fal-ai_llava-next", + feature = "endpoints_fal-ai_fast-fooocus-sdxl", + feature = "endpoints_fal-ai_face-to-sticker", + feature = "endpoints_fal-ai_moondream", + feature = "endpoints_fal-ai_sadtalker", + feature = "endpoints_fal-ai_musetalk", + feature = "endpoints_fal-ai_dubbing", + feature = "endpoints_fal-ai_layer-diffusion", + feature = "endpoints_fal-ai_stable-diffusion-v15", + feature = "endpoints_fal-ai_pixart-sigma", + feature = "endpoints_fal-ai_dreamshaper", + feature = "endpoints_fal-ai_realistic-vision", + feature = "endpoints_fal-ai_lightning-models", + feature = "endpoints_fal-ai_omni-zero", + feature = "endpoints_fal-ai_leffa", + feature = "endpoints_fal-ai_cat-vton", + feature = "endpoints_fal-ai_dwpose", + feature = "endpoints_fal-ai_florence-2-large", + feature = "endpoints_fal-ai_era-3d", + feature = "endpoints_fal-ai_live-portrait", + feature = "endpoints_fal-ai_kolors", + feature = "endpoints_fal-ai_sdxl-controlnet-union", + feature = "endpoints_fal-ai_sam2", + feature = "endpoints_fal-ai_evf-sam", + feature = "endpoints_fal-ai_sa2va", + feature = "endpoints_fal-ai_mini-cpm", + feature = "endpoints_fal-ai_controlnext", + feature = "endpoints_fal-ai_workflowutils", + feature = "endpoints_fal-ai_image-preprocessors", + feature = "endpoints_fal-ai_f5-tts", + feature = "endpoints_fal-ai_kokoro", + feature = "endpoints_fal-ai_trellis", + feature = "endpoints_fal-ai_hunyuan3d", + feature = "endpoints_fal-ai_playai", + feature = "endpoints_fal-ai_latentsync", + feature = "endpoints_fal-ai_moondream-next", + feature = "endpoints_fal-ai_recraft-clarity-upscale", + feature = "endpoints_fal-ai_recraft-creative-upscale", + feature = "endpoints_fal-ai_elevenlabs", + feature = "endpoints_fal-ai_janus", + feature = "endpoints_fal-ai_imagen3", + feature = "endpoints_fal-ai_gemini-flash-edit", + feature = "endpoints_fal-ai_post-processing", + feature = "endpoints_fal-ai_video-prompt-generator", + feature = "endpoints_fal-ai_eye-correct", + feature = "endpoints_fal-ai_topaz", + feature = "endpoints_fal-ai_csm-1b", + feature = "endpoints_fal-ai_pika", + feature = "endpoints_fal-ai_invisible-watermark" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fal-ai", + feature = "endpoints_fal-ai_sync-lipsync", + feature = "endpoints_fal-ai_veo2", + feature = "endpoints_fal-ai_minimax-music", + feature = "endpoints_fal-ai_diffrhythm", + feature = "endpoints_fal-ai_yue", + feature = "endpoints_fal-ai_flux-pro", + feature = "endpoints_fal-ai_ideogram", + feature = "endpoints_fal-ai_hunyuan-video-lora-training", + feature = "endpoints_fal-ai_flux-lora-fast-training", + feature = "endpoints_fal-ai_flux-lora-portrait-trainer", + feature = "endpoints_fal-ai_flux-pro-trainer", + feature = "endpoints_fal-ai_recraft-v3", + feature = "endpoints_fal-ai_minimax", + feature = "endpoints_fal-ai_minimax-image", + feature = "endpoints_fal-ai_hyper3d", + feature = "endpoints_fal-ai_aura-flow", + feature = "endpoints_fal-ai_flux", + feature = "endpoints_fal-ai_flux-lora", + feature = "endpoints_fal-ai_flux-subject", + feature = "endpoints_fal-ai_flux-lora-canny", + feature = "endpoints_fal-ai_flux-lora-depth", + feature = "endpoints_fal-ai_sana", + feature = "endpoints_fal-ai_omnigen-v1", + feature = "endpoints_fal-ai_lumina-image", + feature = "endpoints_fal-ai_stable-diffusion-v35-large", + feature = "endpoints_fal-ai_stable-diffusion-v35-medium", + feature = "endpoints_fal-ai_switti", + feature = "endpoints_fal-ai_recraft-20b", + feature = "endpoints_fal-ai_bria", + feature = "endpoints_fal-ai_flux-lora-fill", + feature = "endpoints_fal-ai_flux-control-lora-canny", + feature = "endpoints_fal-ai_flux-control-lora-depth", + feature = "endpoints_fal-ai_flux-general", + feature = "endpoints_fal-ai_flux-pulid", + feature = "endpoints_fal-ai_iclight-v2", + feature = "endpoints_fal-ai_flux-differential-diffusion", + feature = "endpoints_fal-ai_stable-diffusion-v3-medium", + feature = "endpoints_fal-ai_fast-sdxl", + feature = "endpoints_fal-ai_lora", + feature = "endpoints_fal-ai_aura-sr", + feature = "endpoints_fal-ai_codeformer", + feature = "endpoints_fal-ai_thera", + feature = "endpoints_fal-ai_ddcolor", + feature = "endpoints_fal-ai_swin2sr", + feature = "endpoints_fal-ai_mix-dehaze-net", + feature = "endpoints_fal-ai_docres", + feature = "endpoints_fal-ai_nafnet", + feature = "endpoints_fal-ai_drct-super-resolution", + feature = "endpoints_fal-ai_ben", + feature = "endpoints_fal-ai_flowedit", + feature = "endpoints_fal-ai_zonos", + feature = "endpoints_fal-ai_stable-cascade", + feature = "endpoints_fal-ai_mochi-v1", + feature = "endpoints_fal-ai_stepfun-video", + feature = "endpoints_fal-ai_hunyuan-video", + feature = "endpoints_fal-ai_hunyuan-video-image-to-video", + feature = "endpoints_fal-ai_hunyuan-video-img2vid-lora", + feature = "endpoints_fal-ai_hunyuan-video-lora", + feature = "endpoints_fal-ai_wan", + feature = "endpoints_fal-ai_wan-t2v", + feature = "endpoints_fal-ai_wan-i2v", + feature = "endpoints_fal-ai_wan-i2v-lora", + feature = "endpoints_fal-ai_wan-trainer", + feature = "endpoints_fal-ai_wan-pro", + feature = "endpoints_fal-ai_wan-effects", + feature = "endpoints_fal-ai_skyreels-i2v", + feature = "endpoints_fal-ai_vidu", + feature = "endpoints_fal-ai_video-upscaler", + feature = "endpoints_fal-ai_auto-caption", + feature = "endpoints_fal-ai_mmaudio-v2", + feature = "endpoints_fal-ai_luma-dream-machine", + feature = "endpoints_fal-ai_luma-photon", + feature = "endpoints_fal-ai_kling", + feature = "endpoints_fal-ai_kling-video", + feature = "endpoints_fal-ai_pixverse", + feature = "endpoints_fal-ai_transpixar", + feature = "endpoints_fal-ai_cogvideox-5b", + feature = "endpoints_fal-ai_cogview4", + feature = "endpoints_fal-ai_ltx-video", + feature = "endpoints_fal-ai_ltx-video-v095", + feature = "endpoints_fal-ai_stable-video", + feature = "endpoints_fal-ai_fast-svd", + feature = "endpoints_fal-ai_fast-svd-lcm", + feature = "endpoints_fal-ai_birefnet", + feature = "endpoints_fal-ai_got-ocr", + feature = "endpoints_fal-ai_creative-upscaler", + feature = "endpoints_fal-ai_ffmpeg-api", + feature = "endpoints_fal-ai_clarity-upscaler", + feature = "endpoints_fal-ai_ccsr", + feature = "endpoints_fal-ai_fast-turbo-diffusion", + feature = "endpoints_fal-ai_fast-lcm-diffusion", + feature = "endpoints_fal-ai_whisper", + feature = "endpoints_fal-ai_wizper", + feature = "endpoints_fal-ai_fast-lightning-sdxl", + feature = "endpoints_fal-ai_hyper-sdxl", + feature = "endpoints_fal-ai_playground-v25", + feature = "endpoints_fal-ai_amt-interpolation", + feature = "endpoints_fal-ai_t2v-turbo", + feature = "endpoints_fal-ai_sd15-depth-controlnet", + feature = "endpoints_fal-ai_photomaker", + feature = "endpoints_fal-ai_lcm", + feature = "endpoints_fal-ai_lcm-sd15-i2i", + feature = "endpoints_fal-ai_fooocus", + feature = "endpoints_fal-ai_animatediff-v2v", + feature = "endpoints_fal-ai_fast-animatediff", + feature = "endpoints_fal-ai_illusion-diffusion", + feature = "endpoints_fal-ai_imageutils", + feature = "endpoints_fal-ai_esrgan", + feature = "endpoints_fal-ai_fast-sdxl-controlnet-canny", + feature = "endpoints_fal-ai_inpaint", + feature = "endpoints_fal-ai_animatediff-sparsectrl-lcm", + feature = "endpoints_fal-ai_pulid", + feature = "endpoints_fal-ai_ip-adapter-face-id", + feature = "endpoints_fal-ai_stable-audio", + feature = "endpoints_fal-ai_diffusion-edge", + feature = "endpoints_fal-ai_triposr", + feature = "endpoints_fal-ai_retoucher", + feature = "endpoints_fal-ai_any-llm", + feature = "endpoints_fal-ai_llavav15-13b", + feature = "endpoints_fal-ai_llava-next", + feature = "endpoints_fal-ai_fast-fooocus-sdxl", + feature = "endpoints_fal-ai_face-to-sticker", + feature = "endpoints_fal-ai_moondream", + feature = "endpoints_fal-ai_sadtalker", + feature = "endpoints_fal-ai_musetalk", + feature = "endpoints_fal-ai_dubbing", + feature = "endpoints_fal-ai_layer-diffusion", + feature = "endpoints_fal-ai_stable-diffusion-v15", + feature = "endpoints_fal-ai_pixart-sigma", + feature = "endpoints_fal-ai_dreamshaper", + feature = "endpoints_fal-ai_realistic-vision", + feature = "endpoints_fal-ai_lightning-models", + feature = "endpoints_fal-ai_omni-zero", + feature = "endpoints_fal-ai_leffa", + feature = "endpoints_fal-ai_cat-vton", + feature = "endpoints_fal-ai_dwpose", + feature = "endpoints_fal-ai_florence-2-large", + feature = "endpoints_fal-ai_era-3d", + feature = "endpoints_fal-ai_live-portrait", + feature = "endpoints_fal-ai_kolors", + feature = "endpoints_fal-ai_sdxl-controlnet-union", + feature = "endpoints_fal-ai_sam2", + feature = "endpoints_fal-ai_evf-sam", + feature = "endpoints_fal-ai_sa2va", + feature = "endpoints_fal-ai_mini-cpm", + feature = "endpoints_fal-ai_controlnext", + feature = "endpoints_fal-ai_workflowutils", + feature = "endpoints_fal-ai_image-preprocessors", + feature = "endpoints_fal-ai_f5-tts", + feature = "endpoints_fal-ai_kokoro", + feature = "endpoints_fal-ai_trellis", + feature = "endpoints_fal-ai_hunyuan3d", + feature = "endpoints_fal-ai_playai", + feature = "endpoints_fal-ai_latentsync", + feature = "endpoints_fal-ai_moondream-next", + feature = "endpoints_fal-ai_recraft-clarity-upscale", + feature = "endpoints_fal-ai_recraft-creative-upscale", + feature = "endpoints_fal-ai_elevenlabs", + feature = "endpoints_fal-ai_janus", + feature = "endpoints_fal-ai_imagen3", + feature = "endpoints_fal-ai_gemini-flash-edit", + feature = "endpoints_fal-ai_post-processing", + feature = "endpoints_fal-ai_video-prompt-generator", + feature = "endpoints_fal-ai_eye-correct", + feature = "endpoints_fal-ai_topaz", + feature = "endpoints_fal-ai_csm-1b", + feature = "endpoints_fal-ai_pika", + feature = "endpoints_fal-ai_invisible-watermark" + ))) +)] +pub mod fal_ai; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_fashn", + feature = "endpoints_fashn_tryon" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_fashn", + feature = "endpoints_fashn_tryon" + ))) +)] +pub mod fashn; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod rundiffusion_fal; diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/image_to_image/mod.rs new file mode 100644 index 0000000000..1127da9040 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/image_to_image/mod.rs @@ -0,0 +1,248 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], improving quality while preserving lora support. +pub fn image_to_image(params: DevImageToImageInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/juggernaut-flux/base/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/mod.rs new file mode 100644 index 0000000000..dae5663429 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/mod.rs @@ -0,0 +1,274 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], improving quality while preserving lora support. +pub fn base(params: DevTextToImageInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/base", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/redux/mod.rs new file mode 100644 index 0000000000..c2310f2eb5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/base/redux/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], improving quality while preserving lora support. +pub fn redux(params: DevReduxInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/base/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/mod.rs new file mode 100644 index 0000000000..63e4de24f1 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/mod.rs @@ -0,0 +1,260 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Juggernaut Lightning, for fastest text-to-image generation. +pub fn lightning(params: SchnellTextToImageInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/lightning", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/redux/mod.rs new file mode 100644 index 0000000000..0232fbf5f6 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/lightning/redux/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Juggernaut Lightning, for fastest text-to-image generation. +pub fn redux(params: SchnellReduxInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/lightning/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/mod.rs new file mode 100644 index 0000000000..c8ebb69793 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/mod.rs @@ -0,0 +1,288 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod base; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod lightning; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod pro; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn juggernaut_flux(params: DevTextToImageInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/image_to_image/mod.rs new file mode 100644 index 0000000000..623e2e264c --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/image_to_image/mod.rs @@ -0,0 +1,248 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], for superior text-to-image generation. +pub fn image_to_image(params: DevImageToImageInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/juggernaut-flux/pro/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/mod.rs new file mode 100644 index 0000000000..49bf9a5ddd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/mod.rs @@ -0,0 +1,274 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod redux; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], for superior text-to-image generation. +pub fn pro(params: DevTextToImageInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/pro", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/redux/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/redux/mod.rs new file mode 100644 index 0000000000..10a9671dfd --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux/pro/redux/mod.rs @@ -0,0 +1,245 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "a cat dressed as a wizard with a background of a mystic forest." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength of the initial image. Higher strength values are better for this model. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DevTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellReduxInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The URL of the image to generate an image from. + /// "https://fal.media/files/kangaroo/acQvq-Kmo2lajkgvcEHdv.png" + pub image_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SchnellTextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Finetuned version of FLUX.1 [dev], for superior text-to-image generation. +pub fn redux(params: DevReduxInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux/pro/redux", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/image_to_image/mod.rs new file mode 100644 index 0000000000..ac846ed32e --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/image_to_image/mod.rs @@ -0,0 +1,238 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base LoRA +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Juggernaut Flux, finetuned for better image generation with LoRA support +pub fn image_to_image(params: ImageToImageInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/juggernaut-flux-lora/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/inpainting/mod.rs new file mode 100644 index 0000000000..e8c5a5a931 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/inpainting/mod.rs @@ -0,0 +1,235 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base LoRA +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Juggernaut Flux, finetuned for better image generation with LoRA support +pub fn inpainting(params: InpaintInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux-lora/inpainting", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/mod.rs new file mode 100644 index 0000000000..c63617f8a9 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/juggernaut_flux_lora/mod.rs @@ -0,0 +1,264 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct InpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct TextToImageInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Juggernaut Flux Base LoRA +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// Juggernaut Flux, finetuned for better image generation with LoRA support +pub fn juggernaut_flux_lora(params: TextToImageInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/juggernaut-flux-lora", params) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/mod.rs new file mode 100644 index 0000000000..b96886f4a5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/mod.rs @@ -0,0 +1,42 @@ +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux" + ))) +)] +pub mod juggernaut_flux; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_juggernaut-flux-lora" + ))) +)] +pub mod juggernaut_flux_lora; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod rundiffusion_photo_flux; diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/image_to_image/mod.rs new file mode 100644 index 0000000000..6717ef1ac8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/image_to_image/mod.rs @@ -0,0 +1,247 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: PhotoLoraI2IInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/rundiffusion-photo-flux/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/inpainting/mod.rs new file mode 100644 index 0000000000..10dceae955 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/inpainting/mod.rs @@ -0,0 +1,247 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn inpainting(params: PhotoLoraInpaintInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/rundiffusion-photo-flux/inpainting", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/image_to_image/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/image_to_image/mod.rs new file mode 100644 index 0000000000..b962ae2c92 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/image_to_image/mod.rs @@ -0,0 +1,247 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn image_to_image(params: PhotoLoraI2IInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/rundiffusion-photo-flux/juggernaut/image-to-image", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/inpainting/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/inpainting/mod.rs new file mode 100644 index 0000000000..04716c68e5 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/inpainting/mod.rs @@ -0,0 +1,247 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn inpainting(params: PhotoLoraInpaintInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/rundiffusion-photo-flux/juggernaut/inpainting", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/mod.rs new file mode 100644 index 0000000000..1448b23b56 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/juggernaut/mod.rs @@ -0,0 +1,276 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod inpainting; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn juggernaut(params: PhotoLoraT2IInput) -> FalRequest { + FalRequest::new( + "rundiffusion-fal/rundiffusion-photo-flux/juggernaut", + params, + ) +} diff --git a/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/mod.rs b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/mod.rs new file mode 100644 index 0000000000..f3b2e6bff8 --- /dev/null +++ b/crates/vendor/fal-rs/src/endpoints/rundiffusion_fal/rundiffusion_photo_flux/mod.rs @@ -0,0 +1,287 @@ +#[allow(unused_imports)] +use crate::prelude::*; +#[allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[allow(unused_imports)] +use std::collections::HashMap; + +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod image_to_image; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod inpainting; +#[cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" +))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "endpoints", + feature = "endpoints_rundiffusion-fal", + feature = "endpoints_rundiffusion-fal_rundiffusion-photo-flux" + ))) +)] +pub mod juggernaut; + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct HTTPValidationError { + #[serde(skip_serializing_if = "Option::is_none")] + pub detail: Option>>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Image { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + pub height: i64, + pub url: String, + pub width: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ImageSize { + /// The height of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub height: Option, + /// The width of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub width: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct LoraWeight { + /// URL or the path to the LoRA weights. + pub path: String, + /// The scale of the LoRA weight. This is used to scale the LoRA weight + /// before merging it with the base model. + #[serde(skip_serializing_if = "Option::is_none")] + pub scale: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Output { + /// Whether the generated images contain NSFW concepts. + pub has_nsfw_concepts: Vec, + /// The generated image files info. + pub images: Vec, + /// The prompt used for generating the image. + pub prompt: String, + /// Seed of the generated Image. It will be the same value of the one passed in the + /// input or the randomly generated that was used in case none was passed. + pub seed: i64, + pub timings: Timings, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraI2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraInpaintInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// URL of image to use for inpainting. or img2img + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" + pub image_url: String, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The mask to area to Inpaint in. + /// "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + pub mask_url: String, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "A photo of a lion sitting on a stone bench" + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// The strength to use for inpainting/image-to-image. Only used if the image_url is provided. 1.0 is completely remakes the image while 0.0 preserves the original. + #[serde(skip_serializing_if = "Option::is_none")] + pub strength: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PhotoLoraT2IInput { + /// If set to true, the safety checker will be enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_safety_checker: Option, + /// The CFG (Classifier Free Guidance) scale is a measure of how close you want + /// the model to stick to your prompt when looking for a related image to show you. + #[serde(skip_serializing_if = "Option::is_none")] + pub guidance_scale: Option, + /// The size of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub image_size: Option, + /// The LoRAs to use for the image generation. You can use any number of LoRAs + /// and they will be merged together to generate the final image. + + #[serde(skip_serializing_if = "Option::is_none")] + pub loras: Option>>, + /// The number of images to generate. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_images: Option, + /// The number of inference steps to perform. + #[serde(skip_serializing_if = "Option::is_none")] + pub num_inference_steps: Option, + /// The format of the generated image. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_format: Option, + /// LoRA Scale of the photo lora model + #[serde(skip_serializing_if = "Option::is_none")] + pub photo_lora_scale: Option, + /// The prompt to generate an image from. + /// "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture." + pub prompt: String, + /// The same seed and the same prompt given to the same version of the model + /// will output the same image every time. + #[serde(skip_serializing_if = "Option::is_none")] + pub seed: Option, + /// If set to true, the function will wait for the image to be generated and uploaded + /// before returning the response. This will increase the latency of the function but + /// it allows you to get the image directly in the response without going through the CDN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sync_mode: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ValidationError { + pub loc: Vec, + pub msg: String, + #[serde(rename = "type")] + pub ty: String, +} + +#[derive(Debug, Serialize, Deserialize, smart_default::SmartDefault)] +#[allow(non_camel_case_types)] +pub enum ImageSizeProperty { + #[default] + ImageSize(ImageSize), + #[serde(rename = "square_hd")] + SquareHd, + #[serde(rename = "square")] + Square, + #[serde(rename = "portrait_4_3")] + Portrait43, + #[serde(rename = "portrait_16_9")] + Portrait169, + #[serde(rename = "landscape_4_3")] + Landscape43, + #[serde(rename = "landscape_16_9")] + Landscape169, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Timings { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub ty: Option, +} + +/// Rundiffusion Photo Flux +/// +/// Category: text-to-image +/// Machine Type: A100 +/// License Type: commercial +/// +/// FLUX.1 [dev], next generation text-to-image model. +pub fn rundiffusion_photo_flux(params: PhotoLoraT2IInput) -> FalRequest { + FalRequest::new("rundiffusion-fal/rundiffusion-photo-flux", params) +} diff --git a/crates/vendor/fal-rs/src/image.rs b/crates/vendor/fal-rs/src/image.rs new file mode 100644 index 0000000000..39e3ebe8eb --- /dev/null +++ b/crates/vendor/fal-rs/src/image.rs @@ -0,0 +1,49 @@ +use std::{future::Future, io::Cursor}; + +use base64::prelude::*; +use image::DynamicImage; + +use crate::FalError; + +#[deprecated(note = "use `reqwest::get` and `image::load_from_memory` instead")] +#[allow(deprecated)] +impl crate::File { + /// Convert the File to an image + pub fn into_image(self) -> impl Future> { + async move { + let image_bytes = reqwest::get(&self.url).await?.bytes().await?; + let output = image::load_from_memory(&image_bytes)?; + Ok(output) + } + } + + /// Convert the file into raw bytes + pub fn into_raw_image(self) -> impl Future, FalError>> { + async move { + let image_bytes = reqwest::get(&self.url).await?.bytes().await?; + Ok(image_bytes.to_vec()) + } + } +} + +pub trait ToDataUrl { + fn to_data_url(&self) -> String; +} + +impl ToDataUrl for DynamicImage { + /// Convert the image into a PNG data URL. + /// This is a convenience function to help with image-to-X endpoints. + fn to_data_url(&self) -> String { + image_to_data_url(self) + } +} + +fn image_to_data_url(image: &image::DynamicImage) -> String { + let mut buf = Vec::new(); + let mut writer = Cursor::new(&mut buf); + image + .write_to(&mut writer, image::ImageFormat::Png) + .unwrap(); + let data = BASE64_STANDARD.encode(&buf); + format!("data:image/png;base64,{}", data) +} diff --git a/crates/vendor/fal-rs/src/lib.rs b/crates/vendor/fal-rs/src/lib.rs new file mode 100644 index 0000000000..2146273f0d --- /dev/null +++ b/crates/vendor/fal-rs/src/lib.rs @@ -0,0 +1,58 @@ +#![cfg_attr(docsrs, feature(doc_cfg))] +#![doc = include_str!("../README.md")] +#![allow(deprecated)] + +pub mod endpoints; +#[cfg(feature = "image")] +pub mod image; +pub mod queue; +pub mod request; + +use eventsource_stream::EventStreamError; +pub use fal_derive::endpoint; + +pub mod prelude { + #[allow(unused_imports)] + pub use super::endpoints::*; + #[cfg(feature = "image")] + pub use super::image::*; + pub use super::queue::*; + pub use super::request::*; + pub use super::*; +} + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, thiserror::Error)] +pub enum FalError { + #[error("fal request failed: {0}")] + RequestError(#[from] reqwest::Error), + #[error("image error: {0}")] + ImageError(#[from] ::image::ImageError), + #[error("serialization error: {0}")] + SerializeError(#[from] serde_json::Error), + #[error("stream error: {0}")] + StreamError(#[from] EventStreamError), + #[error("error: {0}")] + Other(String), +} + +impl From for FalError { + fn from(s: String) -> Self { + FalError::Other(s) + } +} + +#[deprecated(note = "use a type specific to the endpoint, or make your own")] +pub type Image = File; + +#[deprecated(note = "use a type specific to the endpoint, or make your own")] +#[derive(Debug, Deserialize, Serialize, Default)] +pub struct File { + pub url: String, + pub content_type: String, + pub file_name: Option, + pub file_size: Option, + pub width: Option, + pub height: Option, +} diff --git a/crates/vendor/fal-rs/src/queue.rs b/crates/vendor/fal-rs/src/queue.rs new file mode 100644 index 0000000000..2f5d26d563 --- /dev/null +++ b/crates/vendor/fal-rs/src/queue.rs @@ -0,0 +1,158 @@ +use std::marker::PhantomData; + +use eventsource_stream::Eventsource; +use futures::{Stream, StreamExt, TryStreamExt}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; + +use crate::FalError; + +#[derive(Debug, Serialize, Deserialize)] +pub struct QueueResponse { + pub request_id: String, + pub response_url: String, + pub status_url: String, + pub cancel_url: String, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum Status { + InQueue, + InProgress, + Completed, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct RequestLog { + pub timestamp: String, + pub level: String, + pub source: String, + pub message: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct QueueStatus { + /// The status of the Queue request + pub status: Status, + /// The position of the request in the queue + pub queue_position: Option, + /// The URL of the response + pub response_url: String, + /// The logs of the request, if `show_logs` is `true` + pub logs: Option>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Queue { + #[serde(skip)] + pub client: Option, + pub endpoint: String, + pub api_key: String, + pub payload: QueueResponse, + phantom: PhantomData, +} + +impl Queue { + pub fn new( + client: reqwest::Client, + endpoint: impl Into, + api_key: String, + payload: QueueResponse, + ) -> Self { + Self { + client: Some(client), + endpoint: endpoint.into(), + api_key, + payload, + phantom: PhantomData, + } + } + + /// Get the status of the Queue request + /// + /// If `show_logs` is set to true, the logs for the request will be included. + /// Otherwise, they will not be present. + pub async fn status(&self, show_logs: bool) -> Result { + let response = self + .client + .as_ref() + .unwrap() + .get(&self.payload.status_url) + .query(&[("logs", if show_logs { "1" } else { "0" })]) + .header("Authorization", format!("Key {}", self.api_key)) + .header("Content-Type", "application/json") + .send() + .await?; + + Ok(response.error_for_status()?.json().await?) + } + + /// Get the response of the Queue request, if the request is Completed + pub async fn response(&self) -> Result { + let response = self + .client + .as_ref() + .unwrap() + .get(&self.payload.response_url) + .header("Authorization", format!("Key {}", self.api_key)) + .header("Content-Type", "application/json") + .send() + .await?; + + if response.status() != 200 { + let error = response.text().await?; + return Err(error.into()); + } + + Ok(response.error_for_status()?.json().await?) + } + + /// Cancel the Queue request + pub async fn cancel(&self) -> Result<(), FalError> { + let response = self + .client + .as_ref() + .unwrap() + .put(&self.payload.cancel_url) + .header("Authorization", format!("Key {}", self.api_key)) + .send() + .await?; + + response.error_for_status()?; + + Ok(()) + } + + /// Stream the status of the Queue request + /// + /// If `show_logs` is set to true, the logs for the request will be included. + /// Otherwise, they will not be present. + /// Each [`QueueStatus`] will include new logs since the last received status in the stream. + pub async fn stream( + &self, + show_logs: bool, + ) -> Result>, FalError> { + let response = self + .client + .as_ref() + .unwrap() + .get(format!("{}/stream", &self.payload.status_url)) + .query(&[("logs", if show_logs { "1" } else { "0" })]) + .header("Authorization", format!("Key {}", self.api_key)) + .send() + .await?; + + let stream = response.bytes_stream().eventsource(); + + Ok(stream + .map(|event_result| match event_result { + Ok(event) => { + let status: QueueStatus = + serde_json::from_str(&event.data).map_err(|e| FalError::from(e))?; + Ok(status) + } + Err(e) => Err(FalError::from(e)), + }) + .map_err(FalError::from)) + } +} diff --git a/crates/vendor/fal-rs/src/request.rs b/crates/vendor/fal-rs/src/request.rs new file mode 100644 index 0000000000..771c191132 --- /dev/null +++ b/crates/vendor/fal-rs/src/request.rs @@ -0,0 +1,132 @@ +use std::marker::PhantomData; + +use serde::{de::DeserializeOwned, Serialize}; + +use crate::{ + queue::{Queue, QueueResponse}, + FalError, +}; + +/// A request to the FAL API +/// +/// You can provide an API key using the [with_client](crate::request::FalRequest::with_client) function. +/// If no API key is provided, the `FAL_API_KEY` environment variable will be used, if present. +/// +/// ```rust,no_run +/// #[cfg(feature = "endpoints_fal-ai_flux")] +/// # { +/// use fal::prelude::*; +/// use fal::endpoints::fal_ai::flux; +/// +/// #[tokio::main] +/// async fn main() { +/// let api_key = std::env::var("FAL_API_KEY").unwrap(); +/// +/// let response = flux::dev::dev(flux::dev::DevTextToImageInput { +/// prompt: "a majestic horse in a field".to_string(), +/// ..Default::default() +/// }) +/// .with_api_key(api_key) +/// .send() +/// .await +/// .unwrap(); +/// +/// println!("Generated image URL: {}", response.images[0].url); +/// } +/// # } +/// ``` +#[derive(Debug)] +pub struct FalRequest { + /// The Reqwest Client to use to make requests + pub client: reqwest::Client, + /// The endpoint to make the request to + pub endpoint: String, + /// The parameters to send to the endpoint + pub params: Params, + /// The API key to use to make the request + /// If not provided, the `FAL_API_KEY` environment variable will be used + pub api_key: Option, + phantom: PhantomData, +} + +impl FalRequest { + pub fn new(endpoint: impl Into, params: Params) -> Self { + Self { + client: reqwest::Client::new(), + endpoint: endpoint.into(), + params, + api_key: std::env::var("FAL_API_KEY").ok(), + phantom: PhantomData, + } + } + + /// Use a specific Reqwest Client to make requests + pub fn with_client(mut self, client: reqwest::Client) -> Self { + self.client = client; + + self + } + + /// Use a specific API key to make requests + pub fn with_api_key(mut self, api_key: impl Into) -> Self { + self.api_key = Some(api_key.into()); + + self + } + + /// Send the request and wait for the response + pub async fn send(self) -> Result { + let response = self + .client + .post(format!("https://fal.run/{}", self.endpoint)) + .json(&self.params) + .header( + "Authorization", + format!( + "Key {}", + self.api_key.expect( + "No fal API key provided, and FAL_API_KEY environment variable is not set" + ) + ), + ) + .header("Content-Type", "application/json") + .send() + .await?; + + if response.status() != 200 { + let error = response.text().await?; + return Err(error.into()); + } + + Ok(response.error_for_status()?.json().await?) + } + + /// For requests that take longer than several seconds, as it is usually the case with AI applications, we have built a queue system. + /// + /// Utilizing our queue system offers you a more granulated control to handle unexpected surges in traffic. + /// It further provides you with the capability to cancel requests if needed and grants you the observability to monitor your current + /// position within the queue. Besides that using the queue system spares you from the headache of keeping around long running https requests. + pub async fn queue(self) -> Result, FalError> { + let key = self + .api_key + .expect("No fal API key provided, and FAL_API_KEY environment variable is not set"); + + let response = self + .client + .post(format!("https://queue.fal.run/{}", self.endpoint)) + .json(&self.params) + .header("Authorization", format!("Key {}", &key)) + .header("Content-Type", "application/json") + .send() + .await?; + + if response.status() != 200 { + let error = response.text().await?; + return Err(error.into()); + } + + let payload: QueueResponse = response.error_for_status()?.json().await?; + + Ok(Queue::new(self.client, self.endpoint, key, payload)) + } +} diff --git a/crates/vendor/fal-rs/tests/endpoints.rs b/crates/vendor/fal-rs/tests/endpoints.rs new file mode 100644 index 0000000000..1290a07932 --- /dev/null +++ b/crates/vendor/fal-rs/tests/endpoints.rs @@ -0,0 +1,14 @@ +#[tokio::test] +async fn test_fal_ai_flux_dev() { + let response = fal::endpoints::fal_ai::flux::dev::dev( + fal::endpoints::fal_ai::flux::dev::DevTextToImageInput { + prompt: "a horse".to_string(), + ..Default::default() + }, + ) + .send() + .await + .unwrap(); + + assert!(response.images.len() > 0); +} diff --git a/crates/vendor/fal-rs/tests/queue.rs b/crates/vendor/fal-rs/tests/queue.rs new file mode 100644 index 0000000000..115fdf56f1 --- /dev/null +++ b/crates/vendor/fal-rs/tests/queue.rs @@ -0,0 +1,57 @@ +use fal::prelude::*; +use futures::StreamExt; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Deserialize, Serialize, Default)] +pub struct File { + pub url: String, + pub content_type: String, + pub file_name: Option, + pub file_size: Option, + pub width: Option, + pub height: Option, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct FalMultiImageResponse { + pub images: Vec, +} + +#[fal::endpoint(endpoint = "fal-ai/flux/dev")] +fn fal_dev(prompt: String) -> FalMultiImageResponse {} + +#[tokio::test] +async fn test_queue() { + let queue = fal_dev("a horse".to_owned()).queue().await.unwrap(); + + loop { + let status = queue.status(false).await.unwrap(); + + if status.status == Status::Completed { + break; + } + + tokio::time::sleep(std::time::Duration::from_secs(1)).await; + } + + let response = queue.response().await.unwrap(); + + assert!(response.images.len() > 0) +} + +#[tokio::test] +async fn test_queue_status_stream() { + let queue = fal_dev("a horse".to_owned()).queue().await.unwrap(); + + while let Some(status) = queue.stream(false).await.unwrap().next().await { + let status = status.unwrap(); + + if status.status == Status::Completed { + break; + } + } + + let response = queue.response().await.unwrap(); + + assert!(response.images.len() > 0) +} diff --git a/crates/vendor/fal-rs/tests/send.rs b/crates/vendor/fal-rs/tests/send.rs new file mode 100644 index 0000000000..1457d1f8cd --- /dev/null +++ b/crates/vendor/fal-rs/tests/send.rs @@ -0,0 +1,26 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Deserialize, Serialize, Default)] +pub struct File { + pub url: String, + pub content_type: String, + pub file_name: Option, + pub file_size: Option, + pub width: Option, + pub height: Option, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct FalMultiImageResponse { + pub images: Vec, +} + +#[fal::endpoint(endpoint = "fal-ai/flux/dev")] +fn fal_dev(prompt: String) -> FalMultiImageResponse {} + +#[tokio::test] +async fn test_simple_send() { + let response = fal_dev("a horse".to_owned()).send().await.unwrap(); + + assert!(response.images.len() > 0) +}