A dedicated cultivator is a heavy machine that uses its weight to dig deep.
A trimmer cultivator attachment won't go nearly as deep. Ours (a Ryobi) is relatively heavy, and will go around 4 or 5 inches, but I think many won't even go that far.
This probably varies with the model, but with our string trimmer roots get wrapped up in it and I have to cut/pull them off occasionally. If you don't have tree roots to deal with, this probably won't be a problem.
With hard-to-penetrate soil, you may find that a trimmer cultivator doesn't dig in very well.
We have raised beds in wood frames, with some internal cross-braces, so a big Troy Bilt or whatever would likely cause damage.
If you have a big area, I think a dedicated cultivator would be easier and faster. For smaller areas, consider using a garden fork, which is what I use most of the time. I bought a Craftsman fork 30 years ago and am on replacement 4 or 5 now. You can't beat the price!
For a clay soil or other soil with poor tilth, amend the soil (over time) with organic matter. Consider planting winter rye or other cover crop in the off season, and turning it in a few weeks before planting in the spring. Other organic material, like composted cow manure, is good too, of course.
You may want to continue to fork and then use a string trimmer-cultivator to break up the top few inches better. Once the soil's in better shape, you can probably skip the cultivator.