Pirfenidone is used to treat a lung disease called idiopathic pulmonary fibrosis (IPF). IPF causes scar tissue to form deep within your lungs. The scar tissue thickens and becomes stiff or thick over time, which can make it harder for your lungs to work. Decreased lung function can make it hard for you to breathe. Other medical problems can occur when your brain, heart, and other organs do not get enough oxygen.