lucataco
/
moondream2
moondream2 is a small vision language model designed to run efficiently on edge devices
Prediction
lucataco/moondream2:72ccb656IDzeb8kxhz0srgp0cgzvar7ycb4cStatusSucceededSourceWebHardwareA40Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", "prompt": "Describe this image" }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", { input: { image: "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", prompt: "Describe this image" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport replicate
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", input={ "image": "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", "prompt": "Describe this image" } ) # The lucataco/moondream2 model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/lucataco/moondream2/api#output-schema print(item, end="")
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", "input": { "image": "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", "prompt": "Describe this image" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run lucataco/moondream2 using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31 \ -i 'image="https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png"' \ -i 'prompt="Describe this image"'
To learn more, take a look at the Cog documentation.
Pull and run lucataco/moondream2 using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", "prompt": "Describe this image" } }' \ http://localhost:5000/predictions
Output
An astronaut in a white spacesuit is riding a unicorn with a rainbow mane and tail, soaring through a colorful, dreamlike sky with clouds and rainbows.{ "completed_at": "2024-07-29T14:11:47.786770Z", "created_at": "2024-07-29T14:11:46.566000Z", "data_removed": false, "error": null, "id": "zeb8kxhz0srgp0cgzvar7ycb4c", "input": { "image": "https://replicate.delivery/pbxt/LLwjFnbnzMz7uoUCFaO810XTcIXrAbppArVj6MQmBBx4hfrU/astronaut-rainbow-unicorn.png", "prompt": "Describe this image" }, "logs": null, "metrics": { "predict_time": 1.117756106, "total_time": 1.22077 }, "output": [ "", " ", "An ", "astronaut ", "in ", "a ", "white ", "", "spacesuit ", "is ", "riding ", "a ", "unicorn ", "with ", "a ", "rainbow ", "", "mane ", "and ", "", "tail, ", "soaring ", "through ", "a ", "", "colorful, ", "", "dreamlike ", "sky ", "with ", "clouds ", "and ", "", "", "", "rainbows." ], "started_at": "2024-07-29T14:11:46.669014Z", "status": "succeeded", "urls": { "stream": "https://streaming-api.svc.us.c.replicate.net/v1/streams/spztyfs2c4a2tzqg363qkgugq2iqbxozjeno7yllrweaqhutoeya", "get": "https://api.replicate.com/v1/predictions/zeb8kxhz0srgp0cgzvar7ycb4c", "cancel": "https://api.replicate.com/v1/predictions/zeb8kxhz0srgp0cgzvar7ycb4c/cancel" }, "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31" }
Generated inPrediction
lucataco/moondream2:72ccb656IDskrgztcaehrgm0cgzvar0jh8ycStatusSucceededSourceWebHardwareA40Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", "prompt": "Describe this image" }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", { input: { image: "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", prompt: "Describe this image" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport replicate
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", input={ "image": "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", "prompt": "Describe this image" } ) # The lucataco/moondream2 model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/lucataco/moondream2/api#output-schema print(item, end="")
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", "input": { "image": "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", "prompt": "Describe this image" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run lucataco/moondream2 using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31 \ -i 'image="https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp"' \ -i 'prompt="Describe this image"'
To learn more, take a look at the Cog documentation.
Pull and run lucataco/moondream2 using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", "prompt": "Describe this image" } }' \ http://localhost:5000/predictions
Output
A man with a beard and mustache, wearing a suit and red tie, is smiling at the camera with a blue background featuring a logo.{ "completed_at": "2024-07-29T14:12:06.975294Z", "created_at": "2024-07-29T14:12:05.876000Z", "data_removed": false, "error": null, "id": "skrgztcaehrgm0cgzvar0jh8yc", "input": { "image": "https://replicate.delivery/pbxt/LLwjY4nN7wOYDmeQV4TNSuQy2YxMhUW2Fev26yPwNUyj4hev/arnold.webp", "prompt": "Describe this image" }, "logs": null, "metrics": { "predict_time": 0.9948818, "total_time": 1.099294 }, "output": [ "", " ", "A ", "man ", "with ", "a ", "beard ", "and ", "", "mustache, ", "wearing ", "a ", "suit ", "and ", "red ", "", "tie, ", "is ", "smiling ", "at ", "the ", "camera ", "with ", "a ", "blue ", "background ", "featuring ", "a ", "", "", "logo." ], "started_at": "2024-07-29T14:12:05.980413Z", "status": "succeeded", "urls": { "stream": "https://streaming-api.svc.us.c.replicate.net/v1/streams/y2qd3edmrwotw4mbttzvo7i5qaa7g5fptb4phwck4icdswtuz5wq", "get": "https://api.replicate.com/v1/predictions/skrgztcaehrgm0cgzvar0jh8yc", "cancel": "https://api.replicate.com/v1/predictions/skrgztcaehrgm0cgzvar0jh8yc/cancel" }, "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31" }
Generated inPrediction
lucataco/moondream2:72ccb656Input
{ "image": "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", "prompt": "Describe this image" }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", { input: { image: "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", prompt: "Describe this image" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport replicate
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "lucataco/moondream2:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", input={ "image": "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", "prompt": "Describe this image" } ) # The lucataco/moondream2 model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/lucataco/moondream2/api#output-schema print(item, end="")
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run lucataco/moondream2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31", "input": { "image": "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", "prompt": "Describe this image" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run lucataco/moondream2 using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31 \ -i 'image="https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png"' \ -i 'prompt="Describe this image"'
To learn more, take a look at the Cog documentation.
Pull and run lucataco/moondream2 using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/lucataco/moondream2@sha256:72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", "prompt": "Describe this image" } }' \ http://localhost:5000/predictions
Output
The image features a logo with a smiling blue circle above the word "moondream" written in black text.{ "completed_at": "2024-12-06T21:20:04.402628Z", "created_at": "2024-12-06T21:19:51.071000Z", "data_removed": false, "error": null, "id": "cn11yqq13xrme0ckkqbs8ct5n8", "input": { "image": "https://replicate.delivery/pbxt/KZKNhDQHqycw8Op7w056J8YTX5Bnb7xVcLiyB4le7oUgT2cY/moondream2.png", "prompt": "Describe this image" }, "logs": "The attention mask is not set and cannot be inferred from input because pad token is same as eos token.As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\nThe `seen_tokens` attribute is deprecated and will be removed in v4.41. Use the `cache_position` model input instead.", "metrics": { "predict_time": 0.566297241, "total_time": 13.331628 }, "output": [ "", " ", "The ", "image ", "features ", "a ", "logo ", "with ", "a ", "smiling ", "blue ", "circle ", "above ", "the ", "word ", "", "", "", "", "\"moondream\" ", "written ", "in ", "black ", "", "", "text." ], "started_at": "2024-12-06T21:20:03.836331Z", "status": "succeeded", "urls": { "stream": "https://stream-b.svc.ric1.c.replicate.net/v1/streams/efp7elvtevbmebfkshm4zxgcpbccnhtq5rshcn5twpyqzk4f7eoq", "get": "https://api.replicate.com/v1/predictions/cn11yqq13xrme0ckkqbs8ct5n8", "cancel": "https://api.replicate.com/v1/predictions/cn11yqq13xrme0ckkqbs8ct5n8/cancel" }, "version": "72ccb656353c348c1385df54b237eeb7bfa874bf11486cf0b9473e691b662d31" }
Generated inThe attention mask is not set and cannot be inferred from input because pad token is same as eos token.As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results. The `seen_tokens` attribute is deprecated and will be removed in v4.41. Use the `cache_position` model input instead.
Want to make some of these yourself?
Run this model