So the number one AI

WorldwiN International """ To run this code you need to install the following dependencies: pip install google-genai pillow """ import time import os from google import genai from google.genai import types MODEL = "veo-3.1-lite-generate-preview" client = genai.Client( http_options={"api_version": "v1beta"}, api_key=os.environ.get("GEMINI_API_KEY"), ) video_config = types.GenerateVideosConfig( person_generation="dont_allow", # supported values: "dont_allow" or "allow_adult" or "allow_all" aspect_ratio="16:9", # supported values: "16:9" or "16:10" number_of_videos=1, # supported values: 1 - 4 duration_seconds=8, # supported values: 5 - 8 resolution="720p", # supported values: "720p" or "1080p" or "4k" ) def generate(): operation = client.models.generate_videos( model=MODEL, source=types.VideoGenerationSource( prompt="""INSERT_INPUT_HERE""", ), config=video_config, ) # Waiting for the video(s) to be generated while not operation.done: print("Video has not been generated yet. Check again in 10 seconds...") time.sleep(10) operation = client.operations.get(operation) result = operation.result if not result: print("Error occurred while generating video.") return generated_videos = result.generated_videos if not generated_videos: print("No videos were generated.") return print(f"Generated {len(generated_videos)} video(s).") for n, generated_video in enumerate(generated_videos): print(f"Video has been generated: {generated_video.video.uri}") client.files.download(file=generated_video.video) generated_video.video.save(f"video_{n}.mp4") # Saves the video(s) print(f"Video {generated_video.video.uri} has been downloaded to video_{n}.mp4.") if __name__ == "__main__": generate()

Post a Comment

Office Email:- The.Love@iname.com
WorldwiN International Enterprise
This Website about all Type information give to Visitors, Viewers, subscribers, followers Etc . We are publishing news , articles, videos, pictures and all other information or things. So please your are give me your support subscriber , following us . Email us:- gjagjeet610.worldwin@blogger.com , gjagjeet610@gmail.com
Website:- https://worldwininternational.blogspot.com

Previous Post Next Post