Imported from baneeishaque/ljt-520_openclaw-backup (
skills/heyixuan2/bambu-studio-ai/SKILL.md). Install upstream withnpx skills add baneeishaque/ljt-520_openclaw-backup --skill bambu-studio-ai. Copyright stays with the author.
π¨οΈ Bambu Studio AI
Request β Collect Info β Search/Generate β Analyze(11pt) β [Colorize] β Slice β Preview(chat) β Preview(BS) β Confirm β Print β Monitor
Pre-check: If config.json does not exist β run First-Time Setup before any operation.
Quick Reference
| I want to... | Command |
|---|---|
| Printer status | python3 scripts/bambu.py status |
| Print progress | python3 scripts/bambu.py progress |
| Printer hardware info | python3 scripts/bambu.py info |
| Start a print | python3 scripts/bambu.py print <file> --confirmed |
| Pause / Resume / Cancel | python3 scripts/bambu.py pause|resume|cancel |
| Speed mode | python3 scripts/bambu.py speed silent|standard|sport|ludicrous |
| Light on/off | python3 scripts/bambu.py light on|off |
| AMS filament info | python3 scripts/bambu.py ams |
| Camera snapshot | python3 scripts/bambu.py snapshot |
| Send G-code | python3 scripts/bambu.py gcode "G28" |
| Notification | python3 scripts/bambu.py notify --message "done" |
| Generate 3D (text) | python3 scripts/generate.py text "desc" --wait (--raw skips auto-enhancement) |
| Generate 3D (image) | python3 scripts/generate.py image photo.jpg --wait |
| Download model | python3 scripts/generate.py download <task_id> |
| Analyze model | python3 scripts/analyze.py model.stl --orient --repair --material PLA |
| Multi-color | python3 scripts/colorize.py model.glb --height 80 --max_colors 8 -o out.obj (tunable: --min-pct, --no-merge, --island-size, --smooth) |
| Slice | python3 scripts/slice.py model.stl --orient --arrange --quality fine |
| Slice (specific setup) | python3 scripts/slice.py model.stl --printer A1 --filament "Bambu PETG Basic" |
| List slicer profiles | python3 scripts/slice.py --list-profiles |
| Preview (quick) | python3 scripts/preview.py model.stl |
| Preview (HQ Blender) | python3 scripts/preview.py model.stl --hq |
| Search models | python3 scripts/search.py "phone stand" --limit 5 |
| Monitor print | python3 scripts/monitor.py --auto-pause |
| Check deps | python3 scripts/doctor.py |
All scripts support --help. generate.py auto-enhances prompts and limits size to printer build volume.
Overall Flow
User Request
β
βΌ
Information Collection
β
βΌ
Decision 1: Model Source
ββ A: Internet Search (preferred default)
ββ B: AI Generate (single-color)
ββ C: AI Generate (multi-color)
ββ D: User-provided file
β
βΌ
Model Processing (analyze β repair β orient β [colorize] β slice)
β
βΌ
Report Results to User
β
βΌ
β Open in Bambu Studio β User Inspects
β
βΌ
User Confirms ("looks good" / "print it")
β
βΌ
Decision 2: Print Method
ββ E: Auto Print (bambu.py print --confirmed)
ββ F: Manual Print (user handles in Bambu Studio)
β
βΌ
Print Monitoring (auto print only, or on user request)
Step 1: Information Collection
Collect before proceeding:
Model requirements:
- What to print (object description)
- Target dimensions β MUST ask before generating ("How big? e.g., 80mm tall")
- Style / appearance (optional)
Print parameters:
- Single-color or multi-color (AMS)
- Material (default: PLA)
- Quality: draft / standard / fine / extra (optional)
- Purpose: functional or decorative (optional, affects walls + infill)
Model source β ask user:
"Do you want me to:
- π Search online β existing models, usually higher quality
- π¨ AI generate β custom model from scratch
- π€· Not sure β I'll search first, generate if nothing fits"
Default: search first. Common objects (phone stand, hook, vase) almost always exist online.
Step 2: Model Source (Decision Point 1)
Workflow A β Internet Search (preferred)
search.py "query" --limit 5β MakerWorld, Printables, Thingiverse, Thangs- Present results with name, source, URL
- User selects β download β validate format (STL/OBJ/3MF)
- β Model Processing
If no good results β offer AI generate.
Workflow B β AI Generate (single-color)
- First-time disclaimer (once): "AI models depend on provider + prompt. NOT production-ready β always review in Bambu Studio."
- Confirm dimensions
generate.py text "prompt" --waitβ auto-enhances, auto-limits to build volume- β Model Processing
Workflow C β AI Generate (multi-color)
- Same disclaimer as B
- Confirm dimensions + desired colors
generate.py text "prompt" --waitβ textured GLBcolorize.py model.glb --height <size> --max_colors 8β vertex-color OBJ- Pixel HSV classify β greedy area-based color select β CIELAB assign β vertex color
- No shadow removal needed β HSV classification bypasses baked lighting
- Show quantized texture preview to user β send the
_preview.pngimage - Analyze results and suggest tuning if needed:
- Report detected colors with names, hex codes, and percentages
- If small but meaningful colors were lost (e.g., <1% features like eyes, accessories):
β Suggest:
--min-pct 0(keep all colors above 0.1%) - If similar colors are merged incorrectly (e.g., yellow body + brown pants):
β Suggest:
--no-merge(disable family mutual exclusion) - If too many artifact colors appear:
β Suggest: higher
--min-pctor--island-size - If boundaries are too noisy or too smooth:
β Suggest: adjust
--smooth(0=none, 5=default, higher=smoother)
- If user requests changes β re-run colorize with adjusted params β show new preview
- When user approves β Model Processing
Colorize tunable parameters:
| Parameter | Default | Effect |
|---|---|---|
--max_colors N |
8 | Maximum colors (hard limit β€8 for AMS) |
--min-pct X |
0.1 | Min family % threshold (0=keep all, 5=aggressive filter) |
--no-merge |
off | Disable family group exclusion (all 12 families independent) |
--island-size N |
1000 | Remove isolated patches < N pixels (0=disabled) |
--smooth N |
5 | Majority vote boundary passes (0=raw, higher=smoother) |
Workflow D β User-Provided File
- Validate format (STL/OBJ/3MF/GLB), convert if needed
- β Model Processing
Step 3: Model Processing
All models MUST go through this. No exceptions.
Analysis (11-point check):
analyze.py model.stl --orient --repair --material PLA --purpose functional
Checks: dimensional tolerance, wall thickness, load direction, overhangs (>45Β°), print orientation, floating parts, layer height, infill rate, wall count, top layers, material compatibility. Also: watertight, manifold, build volume fit.
Auto-repair: Fix normals, fill holes, remove degenerate faces.
Auto-orient: Optimal stability, auto unit detection (metersβmm).
Report to user (MANDATORY):
- Printability score (X/10)
- Warnings and issues
- Repairs performed
- Recommended settings (layer height, infill, walls, temps, supports)
Example: "Score 8/10. Repaired 58K non-manifold edges. Walls: 1.5mm β Overhangs: 3.2% β Recommended: 0.20mm layers, 20% infill, PLA 210Β°C."
Slice (skip if user will slice in Bambu Studio):
slice.py model.stl --orient --arrange --quality standard
Auto-detects printer + nozzle. Quality: draft(0.24) / standard(0.20) / fine(0.12) / extra(0.08). Output: .3mf with G-code.
Step 4: User Confirmation
β MANDATORY β NEVER SKIP
- Open in Bambu Studio:
open -a "BambuStudio" model_sliced.3mf - Tell user to inspect:
"I've opened the model in Bambu Studio. Please check:
- Does it look correct? Missing or deformed parts?
- Floating/disconnected pieces?
- Correct size? (check dimensions in bottom bar)
- Any red warnings?
- Slice and check: estimated time, filament usage, supports. Let me know when ready!"
- WAIT for explicit confirmation.
β NEVER auto-print. AI models frequently have errors analysis can't fully catch.
- Ask print method:
- Direct automatic printing β Workflow E
- Manual in Bambu Studio β Workflow F
Step 5: Print Execution (Decision Point 2)
Workflow E β Auto Print
bambu.py print model.3mf --confirmed- Confirm: "Print started!"
- β Monitoring
Workflow F β Manual Print
- Model already open in Bambu Studio
- User adjusts settings and prints manually
- Agent does NOT auto-print or auto-monitor
- CAN monitor on request
Step 6: Print Monitoring
Trigger: Auto print (Workflow E) or user request. Requires LAN mode + consent.
β οΈ Always ask: "Want me to monitor? Auto-pause on serious issues?"
| Anomaly | Severity | Action |
|---|---|---|
| Progress stall >10min | Warning | Alert user |
| Temperature anomaly | Critical | Alert + auto-pause |
| Print failure/error | Critical | Alert + auto-pause |
| Unexpected pause | Warning | Alert user |
| Bed detachment | Critical | Auto-pause + alert |
| Spaghetti | Critical | Auto-pause + alert |
Silent when normal. Progress summary every 30 min. Completion notification.
First-Time Setup
Triggered when config.json doesn't exist. Conversational:
- Printer model β A1 Mini, A1, P1S, P2S, X1C, X1E, H2C, H2S, H2D
- Connection β LAN (recommended: IP + serial + access code) or Cloud (email + password, limited)
- 3D generation (optional) β Meshy, Tripo, Printpal, 3D AI Studio + API key
- Notifications β auto / Discord / iMessage / Telegram / etc.
- Save β
config.json+.secrets.json(chmod 600, git-ignored) - Verify (ask permission) β test connection, camera, AMS
- Summary
Environment & Dependencies
Required: python3, pip3
pip3 install bambulabs-api bambu-lab-cloud-api requests trimesh numpy Pillow ddgs
Optional: ffmpeg (camera), Bambu Studio (preview/slicing), Blender 4.0+ (multi-color + HQ preview), OrcaSlicer (CLI slicing)
Env vars (override config.json): BAMBU_MODE, BAMBU_MODEL, BAMBU_EMAIL, BAMBU_IP, BAMBU_SERIAL, BAMBU_3D_PROVIDER
Secrets (.secrets.json, chmod 600): password, access_code, 3d_api_key. All user-provided, never shipped.
Common Issues
| Problem | Fix |
|---|---|
| SSL handshake error (LAN) | Normal (self-signed certs). Handled automatically. |
| API method not found | pip3 install --upgrade bambulabs-api (v2.6.6+) |
| Can't connect (LAN) | LAN Mode ON + correct IP + same network |
| Cloud verification code | Wait for email, enter once. Token cached 24h. |
| Camera timeout | Wake printer (tap screen), check IP. |
| AI model has holes/floating parts | Expected. Always run analyze.py --repair. |
Known Limitations
| Feature | Status |
|---|---|
| Single-color pipeline | β Stable |
| Multi-color (colorize) | β Auto-detect β€8 colors, vertex-color OBJ β BS color merge dialog |
| CLI slicing | β OrcaSlicer backend (BS CLI SEGFAULT in v2.5.0) |
| End-to-end auto-print | π Requires Bambu Studio preview step |
Reference Documents
references/model-specs.mdβ All 9 printer specificationsreferences/bambu_filament_colors.jsonβ Bambu Lab 43-color palette (reference only, colorize v4 uses texture-native colors)references/bambu-mqtt-protocol.mdβ MQTT protocolreferences/bambu-cloud-api.mdβ Cloud APIreferences/3d-generation-apis.mdβ Provider API endpointsreferences/3d-prompt-guide.mdβ Prompt engineering for 3D
License
MIT Β· GitHub: https://github.com/heyixuan2/bambu-studio-ai