Casting a firm sense of Chinese national community is an inevitable requirement for realizing the great rejuvenation of the Chinese nation. Based on the perspective of educational value, the article searches for the path of casting the national community consciousness in the image expression of revolutionary cartoons in the anti-war period. Firstly, a structural equation model is constructed, and historical memory, emotional education, value education and cultural dissemination are selected as the observational variables to express the educational value of cartoons, with national identity as the mediating parameter. Based on the factor analysis model and SEM, the relationship between variables is explored. A questionnaire containing 21 items was also designed for this purpose. The overall KMO value of the scale was as high as 0.936, the combined reliability CR value of all variables was higher than 0.83, and the exploratory factor analysis extracted six common factors with a cumulative variance explained of 72.158%, which fully proved the reliability of the measurement tool. There were significant differences in the expression of national identity and sense of community among students with different political profiles, with within-group sums of squares of 8.642 and 7.318, respectively. All four educational value dimensions significantly and positively influence national identity with path coefficients ranging from 0.194 to 0.321, while the influence of national identity on the image expression of community consciousness is even stronger with a path coefficient of 0.507.