These commands create a project and canvas, add an image node with your prompt, run it, wait for the generation to finish, and print the URL of the result.
# Create a project and a canvasPROJECT=$(mel project create --title "My first project" --fields id --text)CANVAS=$(mel canvas create "$PROJECT" --title "My first canvas" --fields id --text)# Add an image nodeNODE=$(mel node create "$CANVAS" --type image \ --prompt "a golden retriever puppy in a field" \ --aspect-ratio 1:1 --fields id --text)# Run it and block until it's doneRUN=$(mel run start "$NODE" --canvas-id "$CANVAS" --fields id --text)mel run wait "$RUN"# Get the URL of the generated imagemel run download "$RUN"
No model is specified, so Melius picks one for you. To choose one, add --model <name> --variant <variant> (discover options with mel model list --category image).
Every create command returns the created object as JSON. --fields id --text prints just the id so you can capture it in a shell variable — drop those flags to see the full object.
Everything works the same for video — use --type video and a --duration in seconds:
VIDEO=$(mel node create "$CANVAS" --type video \ --prompt "a slow timelapse of clouds over a city skyline" \ --duration 5 --aspect-ratio 16:9 --fields id --text)RUN=$(mel run start "$VIDEO" --canvas-id "$CANVAS" --fields id --text)mel run wait "$RUN"mel run download "$RUN"
Discover video models and their options with mel model list --category video.