🧪 Skills
Google Free Media Skill
สร้างรูปภาพและวิดีโอ AI ฟรีผ่าน Google Gemini และ Google Flow โดยใช้ browser automation ไม่ต้องจ่าย API fe
v1.0.0
Description
name: google-free-media description: สร้างรูปภาพและวิดีโอ AI ฟรีผ่าน Google Gemini และ Google Flow โดยใช้ browser automation ไม่ต้องจ่าย API fee ใช้เมื่อต้องการสร้างสื่อ visual (รูปปก, thumbnail, วิดีโอสั้น) โดยไม่เสียค่าใช้จ่าย
Google Free Media Generator
Skill สำหรับสร้างรูปภาพและวิดีโอ AI ฟรีผ่าน Google Gemini และ Google Flow โดยใช้ browser automation
🎯 เมื่อไหร่ควรใช้ Skill นี้
ใช้เมื่อผู้ใช้ต้องการ:
- สร้างรูปภาพ AI สำหรับ cover, thumbnail, banner
- สร้างวิดีโอจากข้อความหรือรูปภาพ (text-to-video, image-to-video)
- ประหยัดค่า API (0 บาท vs 1-3 บาท/รูป ผ่าน API ปกติ)
- สร้างสื่อจำนวนมากโดยไม่กังวลเรื่องต้นทุน
⚠️ ข้อจำกัดที่ต้องรู้
- Quota ฟรีจำกัด: Gemini ~100 รูป/วัน, Flow ~50 credits/วัน (อาจเปลี่ยนแปลง)
- ช้ากว่า API: ต้องเปิด browser และรอ UI load (5-10x ช้ากว่า)
- เสี่ยง UI เปลี่ยน: Google เปลี่ยนปุ่ม/ตำแหน่งบ่อย → อาจต้อง update skill
- Terms of Service: Automation อาจขัดกับ ToS ของ Google free tier
📋 ขั้นตอนการทำงาน
1. ตรวจสอบ Quota ก่อนเริ่ม
node scripts/quota_manager.mjs check
- ดูว่าเหลือ quota เท่าไหร่
- แจ้งเตือนถ้าใกล้หมด
2. สร้างรูปภาพ (Gemini)
node scripts/generate_image.mjs --prompt "คำอธิบายรูป" --output /path/to/output.jpg
การทำงาน:
- เปิด browser ไปยัง gemini.google.com
- Login (ถ้ายังไม่ได้ login)
- กดปุ่มสร้างรูป (Image generation)
- ส่ง prompt ที่ enhance แล้ว
- รอ generate และดึงรูป full resolution (=s0 trick)
- บันทึกลงไฟล์
3. สร้างวิดีโอ (Google Flow)
node scripts/generate_video.mjs --prompt "คำอธิบายวิดีโอ" --output /path/to/output.mp4
การทำงาน:
- เปิด browser ไปยัง labs.google/flow
- เลือกโหมด (Text-to-Video หรือ Image-to-Video)
- ส่ง prompt หรืออัพโหลดรูป
- รอ generate
- ดาวน์โหลดวิดีโอ
🔧 Scripts
generate_image.mjs
สร้างรูปภาพผ่าน Google Gemini
Arguments:
--prompt: คำอธิบายรูป (required)--output: path ไฟล์ output (required)--style: style ของรูป (optional: realistic, artistic, minimalist)--enhance: ให้ AI enhance prompt อัตโนมัติ (default: true)
generate_video.mjs
สร้างวิดีโอผ่าน Google Flow (Veo 3.1)
Arguments:
--prompt: คำอธิบายวิดีโอ (required)--output: path ไฟล์ output (required)--mode: โหมดการสร้าง (text-to-video, image-to-video)--image: path รูปต้นทาง (สำหรับ image-to-video)--duration: ระยะเวลาวิดีโอ (5-10 วินาที)
quota_manager.mjs
จัดการและติดตาม quota การใช้งาน
Commands:
check: ตรวจสอบ quota ที่เหลือreset: รีเซ็ต counter (เริ่มวันใหม่)log: ดู log การใช้งาน
Config File: configs/quota.json
{
"dailyLimits": {
"images": 100,
"videoCredits": 50
},
"currentUsage": {
"images": 0,
"videoCredits": 0
},
"lastReset": "2026-03-02T00:00:00+07:00"
}
💡 เทคนิคสำคัญ
1. ดึงรูป Full Resolution
รูปบน Gemini แสดงที่ 1024px แต่สามารถดึง full resolution (1408x768) ได้โดยเปลี่ยน URL:
จาก: https://.../image=s1024
เป็น: https://.../image=s0
2. Session Persistence
- Login ครั้งเดียวแล้วเก็บ cookie ไว้ใช้ต่อ
- ไม่ต้อง login ใหม่ทุกครั้งที่สร้างรูป
- ใช้ Puppeteer/Playwright session storage
3. Prompt Enhancement
ก่อนส่งให้ Gemini ควร enhance prompt ให้มี:
- Lighting (soft lighting, dramatic lighting, golden hour)
- Composition (rule of thirds, centered, wide angle)
- Style (photorealistic, cinematic, minimalist, vibrant)
- Quality keywords (4K, ultra detailed, professional)
ตัวอย่าง:
Input: "รูปแมวใส่แว่น"
Enhanced: "A photorealistic portrait of a cute cat wearing round glasses,
soft studio lighting, centered composition, professional photography,
4K ultra detailed, warm tones"
📁 Storage Organization
ไฟล์ที่สร้างจะเก็บที่:
/mnt/storage/ada_projects/ai_media/
├── images/YYYY-MM/
├── videos/YYYY-MM/
└── metadata.json
🔄 Fallback Strategy
ถ้า Google ใช้ไม่ได้ มีทางเลือกสำรอง:
- Bing Image Creator (ฟรี)
- Leonardo.ai (ฟรี tier)
- Stable Diffusion Online
🚨 การแก้ปัญหา
Login ไม่ได้
- ตรวจสอบว่า browser ไม่ใช่ headless mode
- ถ้าใช้ VPS ต้องตั้ง Xvfb เป็นจอเสมือน
- ลอง clear cookie แล้ว login ใหม่
UI เปลี่ยน/ปุ่มหาย
- Update selector ใน scripts
- ตรวจสอบ Google เปลี่ยนตำแหน่งฟีเจอร์
Quota หมด
- รอวันถัดไป (reset ตอน 00:00)
- ใช้ fallback services แทน
📝 ตัวอย่างการใช้งาน
# สร้างรูปปกโพสต์
node scripts/generate_image.mjs \
--prompt "AI workflow diagram, futuristic style, blue and purple gradient" \
--output /mnt/storage/ada_projects/ai_media/images/2026-03/cover_001.jpg \
--style artistic
# สร้างวิดีโอจากข้อความ
node scripts/generate_video.mjs \
--prompt "Ocean waves at sunset, cinematic slow motion" \
--output /mnt/storage/ada_projects/ai_media/videos/2026-03/sunset.mp4 \
--duration 8
# ตรวจสอบ quota
node scripts/quota_manager.mjs check
Reviews (0)
Sign in to write a review.
No reviews yet. Be the first to review!
Comments (0)
No comments yet. Be the first to share your thoughts!