Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
pixray /text2image:5c347a4b
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run pixray/text2image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"pixray/text2image:5c347a4bfa1d4523a58ae614c2194e15f2ae682b57e3797a5bb468920aa70ebf",
{
input: {
drawer: "vqgan",
prompts: "Manhattan skyline at sunset. #artstation 🌇",
settings: "\n"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run pixray/text2image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pixray/text2image:5c347a4bfa1d4523a58ae614c2194e15f2ae682b57e3797a5bb468920aa70ebf",
input={
"drawer": "vqgan",
"prompts": "Manhattan skyline at sunset. #artstation 🌇",
"settings": "\n"
}
)
# The pixray/text2image 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/pixray/text2image/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run pixray/text2image 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": "5c347a4bfa1d4523a58ae614c2194e15f2ae682b57e3797a5bb468920aa70ebf",
"input": {
"drawer": "vqgan",
"prompts": "Manhattan skyline at sunset. #artstation 🌇",
"settings": "\\n"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-01-04T06:40:21Z",
"created_at": "2022-01-04T06:35:16.453894Z",
"data_removed": false,
"error": "",
"id": "bpmogp2wprabndhuyyu73522gi",
"input": {
"prompts": "Manhattan skyline at sunset. #artstation 🌇",
"settings": "\n"
},
"logs": "---> BasePixrayPredictor Predict\r\nUsing seed:\r\n10184741873048389411\r\nUsing device:\r\ncuda:0\r\nOptimising using:\r\nAdam\r\nUsing text prompts:\r\n['Manhattan skyline at sunset. #artstation 🌇']\r\n\r\n0it [00:00, ?it/s]\r\n/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.\r\n warnings.warn(\r\niter: 0, loss: 3.15, losses: 1.06, 0.0803, 0.967, 0.0479, 0.951, 0.0481 (-0=>3.154)\r\n\r\n0it [00:01, ?it/s]\r\n/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.\r\n warnings.warn(\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 10, loss: 3.09, losses: 1.07, 0.0771, 0.942, 0.0435, 0.917, 0.0449 (-0=>3.093)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 20, loss: 3.09, losses: 1.06, 0.0797, 0.929, 0.0453, 0.928, 0.0467 (-4=>3.032)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 30, loss: 2.96, losses: 1.01, 0.0821, 0.889, 0.0488, 0.886, 0.0474 (-0=>2.959)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 40, loss: 2.94, losses: 1, 0.0814, 0.882, 0.0487, 0.872, 0.0482 (-1=>2.891)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 50, loss: 2.85, losses: 0.975, 0.0859, 0.85, 0.0508, 0.841, 0.0474 (-4=>2.83)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 60, loss: 2.74, losses: 0.943, 0.0875, 0.813, 0.0516, 0.797, 0.0477 (-0=>2.74)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 70, loss: 2.72, losses: 0.945, 0.085, 0.804, 0.0501, 0.789, 0.0481 (-4=>2.692)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 80, loss: 2.64, losses: 0.895, 0.0883, 0.785, 0.0516, 0.769, 0.0486 (-2=>2.636)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 90, loss: 2.61, losses: 0.884, 0.0883, 0.778, 0.0509, 0.759, 0.0484 (-1=>2.597)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 100, loss: 2.63, losses: 0.899, 0.0887, 0.781, 0.0492, 0.764, 0.0486 (-11=>2.597)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 110, loss: 2.6, losses: 0.884, 0.0895, 0.771, 0.0495, 0.753, 0.049 (-5=>2.559)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 120, loss: 2.56, losses: 0.865, 0.0886, 0.76, 0.0495, 0.746, 0.0485 (-2=>2.557)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 130, loss: 2.6, losses: 0.884, 0.0881, 0.771, 0.049, 0.758, 0.0481 (-7=>2.556)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 140, loss: 2.58, losses: 0.875, 0.0883, 0.765, 0.0488, 0.755, 0.0479 (-6=>2.519)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 150, loss: 2.58, losses: 0.87, 0.0887, 0.764, 0.0487, 0.761, 0.048 (-1=>2.514)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 160, loss: 2.53, losses: 0.841, 0.09, 0.756, 0.0504, 0.75, 0.0483 (-11=>2.514)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 170, loss: 2.57, losses: 0.862, 0.089, 0.764, 0.0498, 0.752, 0.0488 (-1=>2.513)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 180, loss: 2.55, losses: 0.859, 0.0889, 0.758, 0.0493, 0.747, 0.0488 (-11=>2.513)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 190, loss: 2.56, losses: 0.862, 0.0878, 0.763, 0.0491, 0.755, 0.0485 (-21=>2.513)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 200, loss: 2.58, losses: 0.875, 0.0885, 0.765, 0.0484, 0.76, 0.0482 (-31=>2.513)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 210, loss: 2.58, losses: 0.87, 0.0894, 0.765, 0.0493, 0.757, 0.0489 (-5=>2.508)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 220, loss: 2.58, losses: 0.867, 0.0883, 0.765, 0.0491, 0.762, 0.049 (-15=>2.508)\r\n\r\n0it [00:00, ?it/s]\r\nDropping learning rate\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 230, loss: 2.53, losses: 0.846, 0.0904, 0.748, 0.05, 0.748, 0.0493 (-1=>2.506)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:10, ?it/s]\r\n\r\n0it [00:00, ?it/s]\r\niter: 240, loss: 2.59, losses: 0.88, 0.088, 0.764, 0.0487, 0.761, 0.0482 (-11=>2.506)\r\n\r\n0it [00:00, ?it/s]\r\n\r\n0it [00:03, ?it/s]\r\nTraceback (most recent call last):\r\n File \"/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py\", line 163, in start\r\n self.handle_message(response_queue, message, cleanup_functions)\r\n File \"/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py\", line 232, in handle_message\r\n result = next(return_value)\r\n File \"/src/cogrun.py\", line 132, in predict\r\n yield from super().predict(settings=\"pixray_vdiff\", prompts=prompts, **ydict)\r\n File \"/src/cogrun.py\", line 48, in predict\r\n run_complete = pixray.do_run(settings, return_display=True)\r\n File \"/src/pixray.py\", line 1502, in do_run\r\n keep_going = train(args, cur_iteration)\r\n File \"/src/pixray.py\", line 1367, in train\r\n loss.backward()\r\n File \"/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/_tensor.py\", line 255, in backward\r\n torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)\r\n File \"/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/autograd/__init__.py\", line 147, in backward\r\n Variable._execution_engine.run_backward(\r\n File \"/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py\", line 35, in handle_timeout\r\n raise TimeoutError(self.error_message)\r\nTimeoutError: Prediction timed out",
"metrics": {
"predict_time": 301,
"total_time": 304.546106
},
"output": [
{
"file": "https://replicate.delivery/mgxm/7d3e3aa2-9859-4679-9755-5c8c166c9aae/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/ecf18aee-cdd9-49c7-adf9-71b59a04ea56/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/af7c0e33-e940-4ad1-84ef-aac1f7471653/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/9b1e957a-06d2-412f-81ef-4c95a7ea0f75/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/caa6cbf1-2c7e-4955-ba52-8dd96980f476/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/26418e22-c5dd-4903-9c0a-d61fdd2dd681/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/179edad9-4f0c-41ff-a274-a6a169b842d2/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/a0a49e7f-69bb-4fe2-9608-a746841140ee/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/88a80201-135d-4d05-95fd-b2815edbe50c/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/b8a701f5-c676-423e-917b-6b70c7eb9955/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/4467a54f-6afc-4989-b9c3-985774d8839d/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/0055e7f7-0bdf-4feb-bd89-cf7d74a00233/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/02b0ee4d-e586-4100-bb9f-8cca1a2921f9/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/86873983-d611-480a-a2e9-dbd937b2bdfb/tempfile.png"
},
{
"file": "https://replicate.delivery/mgxm/4eb7ad94-3330-470e-8b3f-5b120bfce2e3/tempfile.png"
}
],
"started_at": "2022-01-04T06:35:20Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/bpmogp2wprabndhuyyu73522gi",
"cancel": "https://api.replicate.com/v1/predictions/bpmogp2wprabndhuyyu73522gi/cancel"
},
"version": "b18734685c2c41ff3ec4e1b6f8fcee1c3f58f8cdbcd11caecfc92a2232d6aeca"
}
---> BasePixrayPredictor Predict
Using seed:
10184741873048389411
Using device:
cuda:0
Optimising using:
Adam
Using text prompts:
['Manhattan skyline at sunset. #artstation 🌇']
0it [00:00, ?it/s]
/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
iter: 0, loss: 3.15, losses: 1.06, 0.0803, 0.967, 0.0479, 0.951, 0.0481 (-0=>3.154)
0it [00:01, ?it/s]
/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 10, loss: 3.09, losses: 1.07, 0.0771, 0.942, 0.0435, 0.917, 0.0449 (-0=>3.093)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 20, loss: 3.09, losses: 1.06, 0.0797, 0.929, 0.0453, 0.928, 0.0467 (-4=>3.032)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 30, loss: 2.96, losses: 1.01, 0.0821, 0.889, 0.0488, 0.886, 0.0474 (-0=>2.959)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 40, loss: 2.94, losses: 1, 0.0814, 0.882, 0.0487, 0.872, 0.0482 (-1=>2.891)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 50, loss: 2.85, losses: 0.975, 0.0859, 0.85, 0.0508, 0.841, 0.0474 (-4=>2.83)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 60, loss: 2.74, losses: 0.943, 0.0875, 0.813, 0.0516, 0.797, 0.0477 (-0=>2.74)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 70, loss: 2.72, losses: 0.945, 0.085, 0.804, 0.0501, 0.789, 0.0481 (-4=>2.692)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 80, loss: 2.64, losses: 0.895, 0.0883, 0.785, 0.0516, 0.769, 0.0486 (-2=>2.636)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 90, loss: 2.61, losses: 0.884, 0.0883, 0.778, 0.0509, 0.759, 0.0484 (-1=>2.597)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 100, loss: 2.63, losses: 0.899, 0.0887, 0.781, 0.0492, 0.764, 0.0486 (-11=>2.597)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 110, loss: 2.6, losses: 0.884, 0.0895, 0.771, 0.0495, 0.753, 0.049 (-5=>2.559)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 120, loss: 2.56, losses: 0.865, 0.0886, 0.76, 0.0495, 0.746, 0.0485 (-2=>2.557)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 130, loss: 2.6, losses: 0.884, 0.0881, 0.771, 0.049, 0.758, 0.0481 (-7=>2.556)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 140, loss: 2.58, losses: 0.875, 0.0883, 0.765, 0.0488, 0.755, 0.0479 (-6=>2.519)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 150, loss: 2.58, losses: 0.87, 0.0887, 0.764, 0.0487, 0.761, 0.048 (-1=>2.514)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 160, loss: 2.53, losses: 0.841, 0.09, 0.756, 0.0504, 0.75, 0.0483 (-11=>2.514)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 170, loss: 2.57, losses: 0.862, 0.089, 0.764, 0.0498, 0.752, 0.0488 (-1=>2.513)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 180, loss: 2.55, losses: 0.859, 0.0889, 0.758, 0.0493, 0.747, 0.0488 (-11=>2.513)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 190, loss: 2.56, losses: 0.862, 0.0878, 0.763, 0.0491, 0.755, 0.0485 (-21=>2.513)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 200, loss: 2.58, losses: 0.875, 0.0885, 0.765, 0.0484, 0.76, 0.0482 (-31=>2.513)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 210, loss: 2.58, losses: 0.87, 0.0894, 0.765, 0.0493, 0.757, 0.0489 (-5=>2.508)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 220, loss: 2.58, losses: 0.867, 0.0883, 0.765, 0.0491, 0.762, 0.049 (-15=>2.508)
0it [00:00, ?it/s]
Dropping learning rate
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 230, loss: 2.53, losses: 0.846, 0.0904, 0.748, 0.05, 0.748, 0.0493 (-1=>2.506)
0it [00:00, ?it/s]
0it [00:10, ?it/s]
0it [00:00, ?it/s]
iter: 240, loss: 2.59, losses: 0.88, 0.088, 0.764, 0.0487, 0.761, 0.0482 (-11=>2.506)
0it [00:00, ?it/s]
0it [00:03, ?it/s]
Traceback (most recent call last):
File "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py", line 163, in start
self.handle_message(response_queue, message, cleanup_functions)
File "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py", line 232, in handle_message
result = next(return_value)
File "/src/cogrun.py", line 132, in predict
yield from super().predict(settings="pixray_vdiff", prompts=prompts, **ydict)
File "/src/cogrun.py", line 48, in predict
run_complete = pixray.do_run(settings, return_display=True)
File "/src/pixray.py", line 1502, in do_run
keep_going = train(args, cur_iteration)
File "/src/pixray.py", line 1367, in train
loss.backward()
File "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/_tensor.py", line 255, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/autograd/__init__.py", line 147, in backward
Variable._execution_engine.run_backward(
File "/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/cog/server/redis_queue.py", line 35, in handle_timeout
raise TimeoutError(self.error_message)
TimeoutError: Prediction timed out
This example was created by a different version, pixray/text2image:b1873468.