Japan would have fought until they all died regardless. The nukes gave the Emperor an excuse to override the military leaders and ordered them to surrender. This satisfied the Japanese code of “honour” because a God told them to commit a disgraceful act of surrender, not themselves. Even then, many still commited seppuku.
This is a pop culture myth. There was some resistance to the idea of unconditional surrender in the Japanese government (partly because of the emperor), but at the time the bombs were dropped, the Japanese leadership had agreed on surrender as their course of action and were attempting to strike a deal with the Soviet Union to mediate the terms on their behalf.