wolfyflutter

www.neuralframes.com [ai] [image to text]

Jun 28th, 2025
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.18 KB | Source Code | 0 0
  1. /*
  2.     base     : https://www.neuralframes.com/tools/image-to-prompt
  3.     fungsi   : ubah gambar menjadi prompt
  4.     update   : 29 Juni 2025
  5.     by       : wolep
  6.     node     : v24.2.0
  7. */
  8.  
  9. const run = async (imageBuffer) => {
  10.     const body = new FormData();
  11.     body.append('file', new File([imageBuffer], Date.now()));
  12.  
  13.     const headers = {
  14.         "authorization": "Bearer uvcKfXuj6Ygncs6tiSJ6VXLxoapJdjQ3EEsSIt45Zm+vsl8qcLAAOrnnGWYBccx4sbEaQtCr416jxvc/zJNAlcDjLYjfHfHzPpfJ00l05h0oy7twPKzZrO4xSB+YGrmCyb/zOduHh1l9ogFPg/3aeSsz+wZYL9nlXfXdvCqDIP9bLcQMHiUKB0UCGuew2oRt",
  15.         ... body.headers
  16.     }
  17.  
  18.     const request = await fetch("https://be.neuralframes.com/clip_interrogate/", {
  19.         headers,
  20.         body,
  21.         "method": "POST",
  22.     })
  23.     const data = await request.json()
  24.     return data
  25. }
  26.  
  27. // cara pakai
  28. const imageBuffer = require("fs").readFileSync("./gambar.jpg")
  29. run(imageBuffer)
  30.     .then(console.log)
  31.     .catch(console.log)
  32.  
  33. /* result
  34. {
  35.   success: true,
  36.   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'
  37. }
  38. */
Add Comment
Please, Sign In to add comment