Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- base : https://www.neuralframes.com/tools/image-to-prompt
- fungsi : ubah gambar menjadi prompt
- update : 29 Juni 2025
- by : wolep
- node : v24.2.0
- */
- const run = async (imageBuffer) => {
- const body = new FormData();
- body.append('file', new File([imageBuffer], Date.now()));
- const headers = {
- "authorization": "Bearer uvcKfXuj6Ygncs6tiSJ6VXLxoapJdjQ3EEsSIt45Zm+vsl8qcLAAOrnnGWYBccx4sbEaQtCr416jxvc/zJNAlcDjLYjfHfHzPpfJ00l05h0oy7twPKzZrO4xSB+YGrmCyb/zOduHh1l9ogFPg/3aeSsz+wZYL9nlXfXdvCqDIP9bLcQMHiUKB0UCGuew2oRt",
- ... body.headers
- }
- const request = await fetch("https://be.neuralframes.com/clip_interrogate/", {
- headers,
- body,
- "method": "POST",
- })
- const data = await request.json()
- return data
- }
- // cara pakai
- const imageBuffer = require("fs").readFileSync("./gambar.jpg")
- run(imageBuffer)
- .then(console.log)
- .catch(console.log)
- /* result
- {
- success: true,
- prompt: 'there are two cats that are sitting on a table with a camera, a stock photo inspired by Hanns Katz, pixabay contest winner, net art, new cats movie, meeting of the cats, kitboga'
- }
- */
Add Comment
Please, Sign In to add comment