If the invitation mentions a costume party, then it's appropriate to wear a costume. Otherwise, stick to formal or semi-formal attire.