The MAGIC (Microlensing Analysis Guided by Intelligent Computation) PyTorch framework efficiently and accurately infers the microlensing parameters of binary events with realistic data quality. The code divides binary microlensing parameters into two groups, which are inferred separately with different neural networks. The neural controlled differential equation handles light curves with irregular sampling and large data gaps. MAGIC can achieve fractional uncertainties of a few percent on the binary mass ratio and separation, and can locate the degenerate solutions even when large data gaps are introduced. As irregular samplings are common in astronomical surveys, this code may be useful for other time series studies.