Many plants lend their common English names to their constituent parts. "A rose" (by any other name), might refer to the entire plant, but it may also mean an individual bloom, perhaps on its stem. To clarify, you'd say something like "I bought a rose bush for the garden."
Some of these common names are widely understood to mean a particular part, by default, if not qualified in this way. This seems to be particularly true of edible parts.
"An apple", unless context suggests otherwise, means the fruit of the apple tree. To refer to the flower, you'd have to say apple blossom. Likewise, "a carrot" means the edible root part of that plant.
Peas, beans, potatoes, nuts etc. follow this pattern.
However, "a sunflower" would be understood by most to mean the distinctive flower itself. If you want to refer to the edible part of that plant (as commonly sold as a snack food), you need to qualify it: "sunflower seeds".
This may be because the original main use of the plant in Western Europe was ornamental, rather than nutritional:
This exotic North American plant was taken to Europe by Spanish explorers some time around 1500. The plant became widespread throughout present-day Western Europe mainly as an ornamental, but some medicinal uses were developed. By 1716, an English patent was granted for squeezing oil from sunflower seed.
(From the National Sunflower Association website.)