vikit_gateway¶
Overview¶
A Gateway to interact with the Vikit API |
- |
|
- |
|
- |
|
- |
Classes¶
- class vikit_gateway.VikitGateway¶
Bases:
vikit.gateways.ML_models_gateway.MLModelsGatewayA Gateway to interact with the Vikit API
Overview
Methods¶ compose_music_from_text_async(prompt_text, duration)Compose a music for a prompt text
generate_background_music_async(duration, prompt)Here we generate the music to add as background music
generate_mp3_from_text_async(prompt_text, target_file)-
generate_mp3_from_text_async_elevenlabs(prompt_text, target_file)Generate an mp3 file from a text prompt.
generate_seine_transition_async(source_image_path, target_image_path)Generate a transition between two videos
Generate a video from the given prompt
generate_video_async(prompt, model_provider)Generate a video from the given prompt
Generate a video from the given image prompt
generate_video_haiper_async(prompt)Generate a video from the given prompt
generate_video_stabilityai_async(prompt)Generate a video from the given prompt
get_enhanced_prompt_async(subtitleText)Generates an enhanced prompt from an original one, probably written by a user or
get_keywords_from_prompt_async(subtitleText, excluded_words)Generates keywords from a subtitle text using the Replicate API.
Generate keywords from a text using the Replicate API
get_subtitles_async(audiofile_path)Extract subtitles from an audio file using the Replicate API
interpolate_async(video)Run some interpolation magic. This model may fail after timeout, so you
Members
- async compose_music_from_text_async(prompt_text: str, duration: int)¶
Compose a music for a prompt text
- Parameters:
prompt_text -- The text prompt
duration -- The duration of the music
- Returns:
The link to the generated music
- async generate_background_music_async(duration: int = 3, prompt: str = None) str¶
Here we generate the music to add as background music
- Parameters:
duration (-) -- int - the duration of the music in seconds
prompt (-) -- str - the prompt to generate the music from
- Returns:
the path to the generated music
- Return type:
str
- async generate_mp3_from_text_async_elevenlabs(prompt_text: str, target_file: str)¶
Generate an mp3 file from a text prompt.
- Parameters:
prompt_text (-) -- str - the text to generate the mp3 from
target_file (-) -- str - the path to the target file
- Returns:
None
- async generate_seine_transition_async(source_image_path, target_image_path)¶
Generate a transition between two videos
- Parameters:
index -- The index of the video
initial -- Whether this is the initial video
- Returns:
The link to the generated video
- async generate_video_VideoCrafter2_async(prompt: str)¶
Generate a video from the given prompt
- Parameters:
prompt -- The prompt to generate the video from
- Returns:
The link to the generated video
- async generate_video_async(prompt: str, model_provider: str)¶
Generate a video from the given prompt
- Parameters:
prompt -- The prompt to generate the video from
model_provider -- The model provider to use
- Returns:
The path to the generated video
- async generate_video_from_image_stabilityai_async(prompt: str)¶
Generate a video from the given image prompt
- Parameters:
prompt -- Image prompt to generate the video from in base64 format
- Returns:
The link to the generated video
- async generate_video_haiper_async(prompt: str)¶
Generate a video from the given prompt
- Parameters:
prompt -- The prompt to generate the video from
- Returns:
The link to the generated video
- async generate_video_stabilityai_async(prompt: str)¶
Generate a video from the given prompt
- Parameters:
prompt -- The prompt to generate the video from
- Returns:
The link to the generated video
- async get_enhanced_prompt_async(subtitleText)¶
Generates an enhanced prompt from an original one, probably written by a user or translated from an audio
- Parameters:
text (A subtitle)
- Returns:
A prompt enhanced by an LLM
- async get_keywords_from_prompt_async(subtitleText, excluded_words: str = None)¶
Generates keywords from a subtitle text using the Replicate API.
- Parameters:
text (A subtitle)
- Returns:
A list of keywords generated by an LLM using the subtitle text
- async get_music_generation_keywords_async(text) str¶
Generate keywords from a text using the Replicate API
At the end of the resulting prompt we get 3 words that will be used to generate a file name out of the generated keywords
- Parameters:
text -- The text to generate keywords from
- Returns:
A list of keywords
- async get_subtitles_async(audiofile_path)¶
Extract subtitles from an audio file using the Replicate API
- Parameters:
i (int) -- The index of the audio slice
- Returns:
The subtitles obtained from the Replicate API
- Return type:
subs
- async interpolate_async(video)¶
Run some interpolation magic. This model may fail after timeout, so you should call it with retry logic
- Parameters:
video -- The video to interpolate
- Returns:
a link to the interpolated video
Attributes¶
- vikit_gateway.KEYWORDS_FORMAT_PROMPT = "' Just list the keywords in english language, separated by a coma, do not re-output the prompt....¶
- vikit_gateway.http_timeout¶
- vikit_gateway.vikit_api_key¶
- vikit_gateway.vikit_backend_url = 'https://videho.replit.app/models'¶