G-code Printer Profile
The one JSON blob that describes your printer (and feeds every G-code node)
- profile
- profile_json
- summary
MKRShift's G-code lane works off a shared type called MKR_GCODE_PROFILE - and this node is where one gets born. Think of it as your printer's spec sheet, packed into a single JSON string and shipped around the graph. The spiral vase and heightmap generators can borrow its geometry, the plan analyzer uses it to judge bed fit and material cost, and the export node won't emit a line of G-code without it. If you're going to print anything this pack generates, you start here.
What it actually does
It turns one big settings_json input into a normalized profile object. Fill in bed size, nozzle diameter, line width, layer height, temperatures, speeds, retraction, and your own start/end G-code, and out comes a profile you can wire into the rest of the lane.
The mechanism is simple but worth knowing: you enter speeds in mm/s (which is how we think about printing - "print at 30 mm/s"), and the node converts them to mm/min internally, because that's the unit the generated G-code's F values speak. Set print_speed_mm_s to 30 and the exported file will carry F1800. Annoying, but correct, and it's the kind of thing you'll stare at once when your first test print moves at a tenth of the speed you asked for.
The origin key matters more than it looks. center positions the part with the origin in the middle of the bed (common on CoreXY machines); lower_left puts it in the corner (the default on many bed slingers). Get this wrong and your carefully generated vase prints halfway off the plate.
The inputs that matter
There's exactly one required input, settings_json, and it's a JSON object with defaults for everything. The defaults describe a "Generic FDM" - 220×220×250 mm bed, 0.4 mm nozzle, 0.45 line width, 0.2 layer height, 210 °C nozzle / 60 °C bed. The keys you'll actually touch on a real machine:
bed_width_mm,bed_depth_mm,bed_height_mm- your build volume.nozzle_diameter_mm,line_width_mm,layer_height_mm- extrusion geometry.print_speed_mm_s,travel_speed_mm_s- the speeds, in mm/s, as discussed.start_gcodeandend_gcode- literal G-code blocks the export node will put at the top and bottom of the file. The defaults are a sensibleM104 S210/M140 S60/G28warmup-and-home, but this is where you'd add your printer's own required ritual (mesh leveling, purge line, filament unload on end).
The rest - retraction, filament diameter, extrusion multiplier, temps - sit in the JSON and flow straight into the generated output.
Outputs
profile(MKR_GCODE_PROFILE) - wire this intoMKRGCodeExport(required there), or into the generators,MKRGCodePlanAnalyzer, andMKRGCodeExternalSliceras optional inputs.profile_json- the same thing as a string, handy for logging or a Show Text node.summary- a one-line human-readable description of the profile.
Installing it
The whole pack installs together - this isn't a standalone node:
# ComfyUI Manager: search "MKRShift Nodes", install, restart.
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
# restart ComfyUI
The pack has no requirements.txt; it only uses numpy, Pillow, and torch, which ComfyUI already ships. No model downloads.
Gotchas
Two things bite. First, it's JSON-in, so malformed JSON quietly falls back to defaults - you won't always get an error, you'll get a profile that isn't yours. Second, the JSON-in-a-text-box workflow is fiddly, and this pack knows it: MKRGCodeOrcaProfileLoader exists precisely so you can pull a real printer preset from OrcaSlicer instead of hand-typing these values. If you already use Orca, load your profiles there and skip this node entirely.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| settings_json | STRING | {"printer_name":"Generic FDM","bed_width_mm":220.0,"bed_depth_mm":220.0,"bed_height_mm":250.0,"origin":"center","offset_x_mm":0.0,"offset_y_mm":0.0,"nozzle_diameter_mm":0.4,"line_width_mm":0.45,"layer_height_mm":0.2,"filament_diameter_mm":1.75,"extrusion_multiplier":1.0,"nozzle_temp_c":210,"bed_temp_c":60,"print_speed_mm_s":30.0,"travel_speed_mm_s":100.0,"retraction_mm":0.8,"retraction_speed_mm_s":35.0,"travel_z_mm":0.6,"home_before_print":true,"prime_line":true,"start_gcode":"M104 S210\nM140 S60\nG28\nG92 E0","end_gcode":"M104 S0\nM140 S0\nG28 X0\nM84"} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| profile | MKR_GCODE_PROFILE | — |
| profile_json | STRING | — |
| summary | STRING | — |