create_midjourney_task

Create a Midjourney image generation task

SDK Method

async def create_midjourney_task(prompt) -> 

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)
    
    # Create a task for Midjourney
    task = await client.create_midjourney_task(
        prompt="Beautiful landscape"
    )
    
    print(task.message) # Print task status message
    print(task.statusCode) # Print task status code
    print(task.data) # Print RequestID
    
if __name__ == '__main__':
    import asyncio
    asyncio.run(main())

For further information go to API Docs

Last updated