There are a minimum of 4 different YZ450F headers available (Gen1 and Gen2); the '03-'05 (Gen1), the '06, the '07, and the '08-'09 (all Gen2).
The '03-'05 was a straight diameter, and can directly replace the the '06 on a YZ, even though the outlet angle is slightly different.
The '06 header is also a straight 40mm (ID) pipe. Measuring a used one often shows the outlet closer to 39mm.
The '07 used a stepped header (not tapered), smaller at the entrance, but larger at the outlet than the '06.
The '08-'09 header was larger yet, but not to match the "higher flowing" YZ head. In fact, it's a compensation for the ridiculously restrictive internal design of the cute little "shorty" muffler they came with. The '08-'09 YZ450F exhaust
system verifiably cuts between 5-7hp at 5000 RPM, the heart of the lower mid range.
From a performance standpoint, the '08-'09 setup was clearly the worst by a considerable margin, and doing almost anything that replaced the muffler added an immediately significant gain in the mid range. But the oversized header is not the way to go if using an aftermarket muffler to improve power, as it interferes with exhaust efficiency at higher speeds. The '06 or '07 headers are a far better choice.
OTOH, if using a more restrictive muffler, inserts, etc., to achieve a quieter exhaust, the '08-'09 header could be the ticket.