Ya 👍 BETUL SEKALI — dan susunannya sudah rapi & benar.
Saya ringkaskan ulang langkah demi langkah (versi final & clean) supaya bisa kamu jadikan catatan permanen.
✅ LANGKAH DEMI LANGKAH (FINAL WORKFLOW)
1️⃣ Install Playwright + Firefox
Dijalankan sekali saja:
npm install playwright
npx playwright install firefox
✔️ Mengunduh Firefox versi Playwright
✔️ Dipakai otomatis oleh script
✔️ Tidak mengganggu Firefox sistem
2️⃣ Struktur folder (SESUAI GAMBAR KAMU ✅)
fire-playwright/
├── downloads/ ← hasil image tersimpan
├── firefox-profile/ ← profile login Firefly (persistent)
├── node_modules/
├── firefly_autodownload_firefox_blob_final.js
├── prompts.txt ← daftar prompt (1 baris = 1 prompt)
├── package.json
└── package-lock.json
📌 Ini struktur ideal & recommended
3️⃣ Isi prompts.txt
Contoh:
faceless child astronaut holding a flag, line art, coloring book style
faceless child baker baking bread in a kitchen, line art, coloring book
faceless child doctor checking a patient, line art illustration
📌 Satu baris = satu prompt
📌 Tidak perlu tanda kutip
4️⃣ Jalankan script
node firefly_autodownload_firefox_blob_final.js
Lalu:
Firefox terbuka (1 window saja ✅)
Login Adobe Firefly manual
Atur:
Model
Aspect ratio
Kembali ke terminal → tekan ENTER
Biarkan script bekerja
5️⃣ Hasil akhir
Image muncul di folder
downloads/Nama file otomatis dari prompt
Tidak dobel
Tidak replace
Aman sampai ratusan prompt
🧠 KENAPA STRUKTUR INI BENAR?
| Komponen | Fungsi |
|---|---|
firefox-profile/ | Simpan login & setting Firefly |
downloads/ | Output aman (bukan blob) |
savedBlobs Set() | Cegah duplikat |
before/after count | Isolasi hasil per prompt |
| Firefox Playwright | Lebih stabil untuk blob |
⚠️ HAL YANG TIDAK PERLU LAGI
❌ Chrome
❌ acceptDownloads
❌ klik tombol Download
❌ rename manual file
❌ copy-paste blob
🏁 KESIMPULAN
✔️ Langkah kamu 100% benar
✔️ Struktur folder ideal
✔️ Workflow sudah matang
✔️ Siap dipakai rutin / skala besar
Ya 👍 BENAR — dari sisi file yang kamu BUAT manual, hanya dua itu.
✅ FILE YANG KAMU BUAT SENDIRI
1️⃣ Script utama
firefly_autodownload_firefox_blob_final.js
✔️ Ini inti semuanya
✔️ Berisi seluruh logic automation
✔️ Tidak perlu file JS lain
2️⃣ Daftar prompt
prompts.txt
✔️ 1 baris = 1 prompt
✔️ Bisa diedit kapan saja
✔️ Bisa ganti, tambah, kurangi tanpa ubah script
📁 FILE / FOLDER LAIN → DIBUAT OTOMATIS
| Item | Dibuat oleh | Keterangan |
|---|---|---|
node_modules/ | npm | Library Playwright |
package.json | npm | Metadata project |
package-lock.json | npm | Lock dependency |
firefox-profile/ | Script | Simpan login Firefly |
downloads/ | Script | Hasil image |
👉 Tidak perlu kamu sentuh
🧠 RINGKASAN SUPER SINGKAT
✍️ Kamu hanya bikin 2 file
⚙️ Sisanya otomatis
🔁 Ganti prompt → tinggal edit
prompts.txt▶️ Jalankan ulang script
💡 Tips kecil (best practice)
Backup
firefox-profile/→ supaya login amanJangan hapus
downloads/saat script jalanKalau ganti akun Adobe → hapus
firefox-profile/lalu login ulang
0 comments:
Post a Comment