Is Image Fake Or Real
by RFour · Aug 11, 2026 ·javascript
Fake means like ai generated stuff :p
JsLazyMalaz
| 1 | const axios = require('axios'); |
| 2 | const FormData = require('form-data'); |
| 3 | const fs = require('fs'); |
| 4 | |
| 5 | async function isimageai(input) { |
| 6 | let buffer; |
| 7 | if (typeof input === 'string' && input.startsWith('http')) { |
| 8 | const res = await axios.get(input, { responseType: 'arraybuffer' }); |
| 9 | buffer = Buffer.from(res.data); |
| 10 | } else if (typeof input === 'string') { |
| 11 | buffer = fs.readFileSync(input); |
| 12 | } else { |
| 13 | buffer = input; |
| 14 | } |
| 15 | const form = new FormData(); |
| 16 | form.append('file', buffer, 'image.jpg'); |
| 17 | const { data } = await axios.post('https://www.nyckel.com/v1/functions/nj3r0lotksgenbzg/invoke', form, { |
| 18 | headers: form.getHeaders() |
| 19 | }); |
| 20 | return data; |
| 21 | } |
| 22 | |
| 23 | isimageai('https://static.wikia.nocookie.net/find-the-noobies-morphs-roblox/images/9/96/Candyland.png/revision/latest/scale-to-width-down/128?cb=20250620072521') |
| 24 | .then(r => console.log(JSON.stringify(r, null, 2))) |
| 25 | .catch(e => console.error(e.message)); |