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.
georgedavila /cog-easytex:b4ac6c02
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 georgedavila/cog-easytex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"georgedavila/cog-easytex:b4ac6c027a1772e7397701d7e11bfdb5d491e37bd1f1931a809e05b1d90c553f",
{
input: {
useTitle: true,
bodyInput: "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum...",
dateInput: "May 8th, 2024",
nameInput: "George",
titleInput: "Report",
separateTitlePage: false
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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 georgedavila/cog-easytex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"georgedavila/cog-easytex:b4ac6c027a1772e7397701d7e11bfdb5d491e37bd1f1931a809e05b1d90c553f",
input={
"useTitle": True,
"bodyInput": "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum...",
"dateInput": "May 8th, 2024",
"nameInput": "George",
"titleInput": "Report",
"separateTitlePage": False
}
)
print(output)
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 georgedavila/cog-easytex 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": "georgedavila/cog-easytex:b4ac6c027a1772e7397701d7e11bfdb5d491e37bd1f1931a809e05b1d90c553f",
"input": {
"useTitle": true,
"bodyInput": "#SECTION A \\n Hello \\n #SUBSECTION B \\n Lorem ipsum...",
"dateInput": "May 8th, 2024",
"nameInput": "George",
"titleInput": "Report",
"separateTitlePage": false
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2024-05-08T21:42:53.365013Z",
"created_at": "2024-05-08T21:40:34.935000Z",
"data_removed": false,
"error": null,
"id": "q6cjtsdbyxrgc0cfb8kags8gyc",
"input": {
"useTitle": true,
"bodyInput": "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum...",
"dateInput": "May 8th, 2024",
"nameInput": "George",
"titleInput": "Report",
"separateTitlePage": false
},
"logs": "['#SECTION A ', ' Hello ', ' #SUBSECTION B ', ' Lorem ipsum...']\nfrom pylatex import Document, Section, Subsection, Subsubsection, Command\nfrom pylatex.utils import italic, NoEscape\nfrom pylatex.section import Chapter, Paragraph, Subparagraph\ndef fill_document(doc):\nwith doc.create(Section(\"A \")):\ndoc.append( NoEscape(\" Hello \") )\nwith doc.create(Subsection(\"B \")):\ndoc.append( NoEscape(\" Lorem ipsum...\") )",
"metrics": {
"predict_time": 2.31221,
"total_time": 138.430013
},
"output": "https://replicate.delivery/pbxt/6f6KABHIaV1jYqF3XcI5jhNfx5etAEBWLM9iuEZWDmK7eoJLB/generated.pdf",
"started_at": "2024-05-08T21:42:51.052803Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/q6cjtsdbyxrgc0cfb8kags8gyc",
"cancel": "https://api.replicate.com/v1/predictions/q6cjtsdbyxrgc0cfb8kags8gyc/cancel"
},
"version": "b4ac6c027a1772e7397701d7e11bfdb5d491e37bd1f1931a809e05b1d90c553f"
}
['#SECTION A ', ' Hello ', ' #SUBSECTION B ', ' Lorem ipsum...']
from pylatex import Document, Section, Subsection, Subsubsection, Command
from pylatex.utils import italic, NoEscape
from pylatex.section import Chapter, Paragraph, Subparagraph
def fill_document(doc):
with doc.create(Section("A ")):
doc.append( NoEscape(" Hello ") )
with doc.create(Subsection("B ")):
doc.append( NoEscape(" Lorem ipsum...") )