Plant stems comprise nodes and internodes that specialize in solute exchange and elongation. However, their boundaries are not well defined, and how these basic units arise remains elusive. In rice with clear nodes and internodes, we found that one subclade of class I knotted1-like homeobox (KNOX1) genes for shoot meristem indeterminacy restricts node differentiation and allows internode formation by repressing YABBY genes for leaf development and genes from another node-specific KNOX1 subclade. YABBYs promote nodal vascular differentiation and limit stem elongation. YABBY and node-specific KNOX1 genes specify the pulvinus, which further elaborates the nodal structure for gravitropism. Notably, this KNOX1 subclade organization is specific to seed plants. We propose that nodes and internodes are distinct domains specified by YABBY-KNOX1 cross-regulation that diverged in early seed plants.