Radiation-induced lung injury (RILI) is one of the most common thoracic-radiotherapy complications, with an incidence as high as 31.4 %. Multiple studies have shown that RILI can adversely affect patient prognosis by disrupting treatment schedules. Moreover, the widespread clinical use of immune-checkpoint inhibitors (ICIs) has further increased pulmonary toxicity when radiotherapy (RT) is combined with ICIs. Checkpoint-inhibitor-related pneumonitis (CIP)-i.e., immune-mediated lung injury-may necessitate permanent discontinuation of ICIs, diminish survival benefit, and, in severe cases, directly threaten life. The diagnosis of both RILI and CIP is based on an integrated assessment of subjective symptoms and imaging findings.RILI typically occurs 1-3 months after completion of radiotherapy, whereas CIP may emerge at any point during treatment. The two entities share similar clinical presentations: fever, dry cough, chest tightness, dyspnoea, and pleuritic chest pain. Computed tomography (CT) is the most sensitive imaging modality. Pulmonary-function testing is another routinely used clinical metric; vital capacity, total lung capacity, forced expiratory volume in 1 s (FEV₁), and diffusing capacity of the lung for carbon monoxide (DLCO) may all decline, with DLCO being the most sensitive parameter. In advanced cases, arterial oxygen and carbon-dioxide tensions may also deteriorate.Currently, RILI is managed empirically with systemic corticosteroids and supportive care; however, this approach yields limited improvement in diffusing capacity or ventilatory function, and its ability to prevent radiation-induced pulmonary fibrosis (RPF) remains undefined. Corticosteroids also remain the mainstay of CIP therapy. Pirfenidone, a potent cytokine inhibitor, attenuates fibroblast activity by reducing production of transforming growth factor-β1 (TGF-β1), platelet-derived growth factor (PDGF), and fibroblast growth factor (FGF), thereby suppressing fibroblast proliferation and extracellular-matrix collagen synthesis. Pre-clinical efficacy studies have demonstrated robust anti-inflammatory, anti-oxidant, and anti-fibrotic effects in the lung.Because RILI and pneumonitis arising from combined radio-immunotherapy are often indistinguishable in clinical practice, and because both share pathogenetic features with idiopathic pulmonary fibrosis (IPF), the investigators initiated this phase II/III trial to address the unmet medical need for effective therapy. Building on prior pre-clinical and clinical data, the study aims to establish the optimal dose of pirfenidone capsules for RILI with or without concomitant CIP and to confirm efficacy and safety.Phase II (dose-finding): The study consists of a screening period (Day -28 to Day -1), a 168-day treatment-observation period (Day 1-Day 168), a safety follow-up (28 ± 7 days after the last dose), and subsequent disease-progression and survival follow-up. Ninety subjects with RILI, with or without CIP, who meet all eligibility criteria will be randomly assigned 1:1:1 to low-dose pirfenidone (400 mg TID), high-dose pirfenidone (600 mg TID), or matching placebo.Phase III (confirmatory): The dose of pirfenidone capsules for phase III will be determined jointly by the sponsor and investigators based on accumulated efficacy and safety data. The trial structure mirrors phase II: screening (Day -28 to Day -1), 168-day treatment-observation (Day 1-Day 168), safety follow-up (28 ± 7 days after the last dose), and disease-progression and survival follow-up. Eligible subjects with RILI ± CIP will be randomized 1:1 to receive either pirfenidone capsules (400 mg or 600 mg TID, taken with meals) or identical placebo. After completion of the 28-day post-treatment follow-up, all phase III participants will enter an extension phase for long-term survival assessment every 3 months (± 7 days).This trial will investigate the progression-free survival (PFS) and overall survival (OS) associated with pirfenidone capsules in patients with Grade 2 and 3 radiation-induced lung injury (RILI), with or without chemotherapy-induced pneumonitis (CIP).