generate_gif

Generate a GIF by text prompt

SDK Method

async def generate_gif(prompt, sampler, negative_prompt="", cfg_scale=10,
steps=30) -> str

Usage example

from VisionCraftAPI import VisionCraftClient

async def main():
    # Set your API key
    api_key = "YOUR_API_KEY"
    
    # Create a VisionCraftClient instance
    client = VisionCraftClient(api_key=api_key)
    
    # Generate a GIF
    gif = await client.generate_gif(
        prompt="A beautiful sunset",
        sampler="Euler"
    )
    
    # Save the GIF to a file
    with open("image.gif", "wb") as file:
        file.write(gif)
    
if __name__ == '__main__':
    import asyncio
    asyncio.run(main())

For further information go to API Docs

Last updated