The reconstruction algorithm based on the network of generative adversarial and contextual coding (RANGC) was proposed in this study to analyze the impacts on the prognosis of patients with giant thoracic tumors with CT imaging under artificial intelligence algorithms. The algorithms of Feldkamp–Davis–Kress (FDK) and the generative adversarial network (GAN) were introduced. The patients were divided into the test group with comfort care and the control group with conventional care. Three sets of indicators below were also compared between the patients in two groups, including the pain level and complication incidence, the self-rating anxiety scale (SAS), the self-rating depression scale (SDS), and the patients’ satisfaction and average duration of hospital stay. When the scanning range was [0°, 89°], the peak signal-to-noise ratio (PSNR) and structural similarity index measurement (SSIM) under the RANGC algorithm were 45.6 dB and 0.99, respectively. When the scanning range changed to [0°, 119°], the PSNR and SSIM were 39.21 dB and 0.98, respectively. The results were significantly higher than those under the FDK and GAN algorithms, and the difference was obviously of statistical significance
P
<
0.05
. The average postoperative pain level of the patients in the control group was 3.12 points, and the postoperative complication incidence was 36.13%, while those of the test group patients were 2.27 points and 20.02%, respectively, which was greatly lower than those of the control group patients, and such a difference was of statistical significance
P
<
0.05
. There was no statistically significant difference in the SDS and SAS scores between the patients in the two groups before surgery. However, the SAS and SDS scores of the test group patients were 41.23 and 43.25, respectively, after surgery, which are obviously lower than those of the control group patients, with a statistically significant difference
P
<
0.05
. The average duration of hospital stay of the test group patients was 6.31 days, which was lower than that of the control group patients, with a statistically significant difference
P
<
0.05
. The overall satisfaction of the test group patients was 83.33%, which was remarkably higher than that of the control group patients, and the difference had statistical significance
P
<
0.05
. All these showed that the performance of the RANGC algorithm was relatively better, and comfort care did good to improve the negative mood, satisfaction, and life quality of patients after surgery.