An image forming apparatus comprising: a temperature sensor configured to detect a temperature; a developing unit configured to supply developer to an image carrier and performs development; a supply unit which contains developer and is configured to supply the contained developer to the developing unit; and a control unit configured to execute developer replacement processing of discharging the developer from the developing unit and supplying the developer contained in the supply unit to the developing unit; wherein the control unit is configured to: perform the developer replacement processing based on a first ratio of a developer supply time during which the supply unit performs supply of the developer for the developing unit and a drive time during which the developing unit is driven and a threshold value obtained based on a detected temperature of the temperature sensor; cumulatively add a first time during which supply of the developer is performed for the developing unit when image formation processing is performed and a second time during which the developing unit is driven when the image formation processing is performed to calculate respectively the developer supply time and the drive time; and add the first time during which supply of the developer is performed for the developing unit to the developer supply time, and add the second time during which the developing unit is driven when the developer replacement processing is performed to the drive time, calculate the first ratio based on the developer supply time and the drive time, and repeatedly calculating the first ratio and executing the developer replacement processing until the repeatedly calculated first ratio becomes less than the threshold value. a temperature sensor configured to detect a temperature; a developing unit configured to supply developer to an image carrier and performs development; a supply unit which contains developer and is configured to supply the contained developer to the developing unit; and a control unit configured to execute developer replacement processing of discharging the developer from the developing unit and supplying the developer contained in the supply unit to the developing unit; wherein the control unit is configured to: perform the developer replacement processing based on a first ratio of a developer supply time during which the supply unit performs supply of the developer for the developing unit and a drive time during which the developing unit is driven and a threshold value obtained based on a detected temperature of the temperature sensor; cumulatively add a first time during which supply of the developer is performed for the developing unit when image formation processing is performed and a second time during which the developing unit is driven when the image formation processing is performed to calculate respectively the developer supply time and the drive time; and add the first time during which supply of the developer is performed for the developing unit to the developer supply time, and add the second time during which the developing unit is driven when the developer replacement processing is performed to the drive time, calculate the first ratio based on the developer supply time and the drive time, and repeatedly calculating the first ratio and executing the developer replacement processing until the repeatedly calculated first ratio becomes less than the threshold value. perform the developer replacement processing based on a first ratio of a developer supply time during which the supply unit performs supply of the developer for the developing unit and a drive time during which the developing unit is driven and a threshold value obtained based on a detected temperature of the temperature sensor; cumulatively add a first time during which supply of the developer is performed for the developing unit when image formation processing is performed and a second time during which the developing unit is driven when the image formation processing is performed to calculate respectively the developer supply time and the drive time; and add the first time during which supply of the developer is performed for the developing unit to the developer supply time, and add the second time during which the developing unit is driven when the developer replacement processing is performed to the drive time, calculate the first ratio based on the developer supply time and the drive time, and repeatedly calculating the first ratio and executing the developer replacement processing until the repeatedly calculated first ratio becomes less than the threshold value.