Nodes/MKRShift_Nodes/G-code Plan Analyzer
ComfyUI Node

G-code Plan Analyzer

The free failure-and-cost review for any MKR G-code plan

By criskb·Created 7 months ago·Updated 5 months ago· 0
G-code Plan Analyzer
  • plan
  • profile
  • plan
  • analysis_json
  • warnings_json
  • summary
settings_json{"max_volumetric_flow_mm3_s":12.0,"min_feature_mm":0.3,"min_layer_time_s":8.0,"warn_travel_ratio_percent":35.0,"warn_bed_usage_percent":75.0,"filament_price_per_kg":20.0,"material_density_g_cm3":1.24,"printer_wattage_w":120.0,"electricity_price_per_kwh":0.2,"warn_total_cost":12.0}

Every FDM hobbyist has a pile of prints that failed for reasons a slicer could have flagged: a layer that printed too fast, an extrusion rate past the hotend's flow ceiling, a model hanging off the bed. MKRGCodePlanAnalyzer is that check, applied to any MKR_GCODE_PLAN this pack generates - before you spend an hour and twenty grams of filament finding out the hard way. It's the node the pack's other G-code nodes keep wanting you to use, and it's worth doing exactly that.

What it checks

Feed it a plan (from the spiral vase, heightmap plate, or a parsed external slice), and it walks the moves computing real engineering numbers: peak and average volumetric flow, print time, material volume, travel overhead, bed coverage, and layer-by-layer print times. Then it flags the classics:

  • Volumetric flow - if any segment exceeds max_volumetric_flow_mm3_s (default 12 mm³/s), your hotend is being asked to melt more plastic than it can. This is the single most common "why did it skip and underextrude" cause.
  • Tiny features - extrude segments shorter than min_feature_mm (default 0.3) that will smear or skip.
  • Short layers - layers under min_layer_time_s (default 8 s) that don't get enough time to cool, so they slump or curl.
  • Travel ratio - too much of the path is non-extruding travel above warn_travel_ratio_percent (default 35%).
  • Bed usage - footprint over warn_bed_usage_percent (default 75%) of the bed area, which needs the profile's bed size to calculate.

It also does the money math: filament cost from filament_price_per_kg and material_density_g_cm3 (1.24 for PLA), plus electricity from printer_wattage_w and electricity_price_per_kwh. Combined with estimated print time you get a real cost estimate before you hit print.

Inputs that matter

  • plan - required.
  • profile - optional, but plug it in: bed-fit and material math need real bed dimensions and extrusion geometry.
  • settings_json - the one required config input, with the warning thresholds and price assumptions above. The defaults are sane; you'll mostly touch filament_price_per_kg and maybe max_volumetric_flow_mm3_s for a high-flow hotend.

Outputs

  • plan - the plan passes straight through unchanged, so the analyzer can sit mid-graph without breaking the pipeline.
  • analysis_json - the full report: layer summaries, flow estimate, bed fit, material use, cost.
  • warnings_json - a flat list of warning strings, ideal for a Show Text node or for routing into logic.
  • summary - a compact human-readable version.

Installing it

Part of the pack:

# ComfyUI Manager: search "MKRShift Nodes", install, restart.
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
# restart ComfyUI

No extra dependencies, no models.

Where it fits

The pack's docs say this node merges the intent of two older G-code-Studio experiments (a "failure analyzer" and a "print time cost estimator") into one ComfyUI-native report node - and that's exactly how to use it: as the gate between a generated plan and the export node. Plan → analyzer → preview → export is the loop. And since warnings_json is plain JSON, you can wire it into anything that reads text. Just remember the analysis is only as good as the profile you give it - analyze with a generic profile and the bed-fit and cost numbers are fiction. Give it your real MKR_GCODE_PROFILE (or the one from MKRGCodeOrcaProfileLoader) and it gets genuinely useful.

CategoryMKRShift Nodes/G-code/Analyze

Inputs (3)

NameTypeDefaultDescription
planMKR_GCODE_PLAN
settings_jsonSTRING{"max_volumetric_flow_mm3_s":12.0,"min_feature_mm":0.3,"min_layer_time_s":8.0,"warn_travel_ratio_percent":35.0,"warn_bed_usage_percent":75.0,"filament_price_per_kg":20.0,"material_density_g_cm3":1.24,"printer_wattage_w":120.0,"electricity_price_per_kwh":0.2,"warn_total_cost":12.0}
profileoptMKR_GCODE_PROFILE

Outputs (4)

NameTypeDescription
planMKR_GCODE_PLAN
analysis_jsonSTRING
warnings_jsonSTRING
summarySTRING