If you are suggesting that the front hub Dynamo will offset the electrical requirement of the mid drive, I suggest that this perpetual motion concept has proven unattainable to scientists for years.
If you had a one to one ratio of load to electricity produced to electricity generated, the force required to turn the front wheel would equal that of the rear hub/ mid drive, for a zero sum gain. Your efforts to turn the crank and pedals would essentially be the same as having all of the electrical leads disconnected, and, you would be pedaling the extra mass of the hardware around. I you installed a front hub generator that produced a greater amount of energy than the rear drive drew, your legs would in effect have to make up the differential energy, which would negate the benefit of the installation.
The only "free electricity" would involve something in the order of a regenerative braking system, which would convert some of your kinetic energy produced by you coasting to a stop, or running down a hill to electrical energy for battery storage. It would likely only amount to a very small percentage of recovery in real world applications. The upside is that you will experience longer brake pad life, the downside is that you will not coast downhill as fast or as far running a regenerative circuit.
In all of these scenarios, I have not included the all too critical variables of heat and friction and generator efficiency, that must be taken into account in any mathematical calculation of any benefits gained.
Even in a perfect vacuum (not yet attainable) with magnetic levitation for bearings, there has not been a perpetual motion machine developed yet.
But one can always hope!