Sequence planning of models for a mixed-model assembly line is crucial for the line efficiency. This paper formalized this model sequencing problem based on minimizing the total cost of idle time and overtime. An adapted Particle Swarm Optimization (PSO) algorithm was proposed to optimize the problem. To avoid early convergence of the particles, an immunity mechanism was introduced into the algorithm. The particle was replaced in time to keep the diversity according to the particle affinity and consistency, and so to avoid being trapped into local optimum. Furthermore, the solutions yielded by these approaches were compared to the traditional PSO algorithm, and the results showed that the method is perfect for sequence planning of mixed-model assembly lines.