I’m not quite sure what your visa status is.
If you have the Spouse or child of Japanese national visa, you can engage in almost any work activities.
If you have the Dependent (Family) visa, which is granted if your husband is non-Japanese, you can work up to 28 hours per week provided you apply for permission to do so. There seems to be an exception if your husband has the Highly Skilled Foreign Professional visa, in which case you can work full time.
Either way, I believe there isn’t any restriction on the type of work, apart from being prohibited to work in the sex industry, which obviously isn’t relevant. I highly doubt there’s any restrictions on freelancing, but if you want to be extra sure, you could try to confirm by calling them.
Your Japanese visa is only relevant when physically working in Japan. If you’re in the US, you can do whatever work you want without issue, even if it is for a Japanese company.
The only tricky part I see will be figuring out what to do from a tax perspective. If you’re a Japanese resident, you need to pay taxes (and health insurance, pension, etc here). If you leave Japan temporarily, you’ll still be considered a resident here. If you leave permanently, you won’t, and so don’t need to pay taxes if your employer is Japanese. I’m not sure what happens if you only leave for six months though. This is actually independent of whether you’re freelancing or not, as all residents of Japan are obliged to be enrolled in national health insurance and pension, regardless of whether they’re employed. Furthermore, as an American citizen, your taxes are more complicated as the US is one of the few countries in the world where even non-residents need to pay tax, and so you’ll also need to figure out things from that side. This isn’t anything I have personal experience with, so I’m afraid I can’t offer any advice.