/install google-free-media-skill
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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install google-free-media-skill - After installation, invoke the skill by name or use
/google-free-media-skill - Provide required inputs per the skill's parameter spec and get structured output
What is Google Free Media Skill?
สร้างรูปภาพและวิดีโอ AI ฟรีผ่าน Google Gemini และ Google Flow โดยใช้ browser automation ไม่ต้องจ่าย API fee ใช้เมื่อต้องการสร้างสื่อ visual (รูปปก, thumbnail... It is an AI Agent Skill for Claude Code / OpenClaw, with 264 downloads so far.
How do I install Google Free Media Skill?
Run "/install google-free-media-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Google Free Media Skill free?
Yes, Google Free Media Skill is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Google Free Media Skill support?
Google Free Media Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Google Free Media Skill?
It is built and maintained by pbseiya (@pbseiya); the current version is v1.0.0.