An image forming apparatus includes a developing device configured to
develop an electrostatic image on an image carrier with developer, and a
developer container detachably attachable to the image forming apparatus
and configured to store developer to be supplied to the developing
device. A developer supply unit is configured to supply the developer
from the developer container to the developing device. The developer
supply unit includes a developer detector configured to detect the amount
of developer in the developer supply unit. The image forming apparatus
controls the supply of developer transported via the developer supply
unit and disables image formation on the basis of the detection result
obtained from the developer detector. After the image formation is
disabled, when the completion of the replacement of the developer
container is detected, the image forming apparatus canceled the disabled
image formation regardless of the detection result obtained from the
developer detector.