This is the flag of the Republic of Ezo. It comes from a world where the Boshin War went slightly more favorably for the Shogunate forces. As a result, the Meiji government was forced to, at least temporarily, recognize the Republic of Ezo. It wasn't long before the Japanese declared war on Ezo once again. However, the Satsuma Rebellion still happened and was a lot more widespread, emboldened by Ezo's success. The Meiji government was forced to focus on quelling the Satsuma Rebellion. Ezo was able to find support from France and Russia to help protect them from the Japanese. Eventually, Japan had no choice but to formally recognize the Ezo government.
In response to Ezo's alliance with France and Russia, Japan strengthened its ties to Britain and Germany. Following their failure to capture Hokkaido, the Japanese turned their attention to Korea. Ezo, under the command of the recently defected Saigo Takamori, also sent an expedition to conquer Korea. Korea was able to play Japan and Ezo off of each other, and was able to maintain its independence. In time, Korea was able to modernize and industrialize like Japan had. Japan was humbled by its failure in Korea, and the Japanese were forced to focus more on domestic policy than foreign conquest.
Ezo also pursued a policy of isolationism following the failed expedition to Korea. Some industrialization was a necessary evil, but on the whole Ezo strived to maintain as much of its traditional culture and way of life as possible. As time went on, however, Ezo began to increasingly fall under French influence. In many way, it could be said that Ezo had become a French protectorate.
World War I started off around the same time, and with very similar circumstances, as our world. However, in this world Japan fought for the Central Powers. The Japanese were bitter at the British for selling weapons to Ezo, resentful growing opposition to the creeping British influence on Japanese society, and their alliance with Germany was as strong as ever. Ezo initially tried to remain neutral, but a surprise Japanese attack prompted Ezo to join the Entente Powers. The war ended in an Entente victory. Japan was placed under crushing reparations to Ezo, and was forced to cease land in northern Japan to Ezo.
Japan began to grow resentful against Ezo, and began to rearm for another war. Ezo and Korea were subjected to a series of harsh bombing campaigns. It wasn't long before Ezo and Korea were forced to surrender and formerly occupied by Japan. The Japanese continued to expand their influence across East Asia and the Pacific. It wasn't long, however, before they found themselves in conflict with the United States. Like in our world, the war ended in an American victory.
Ezo regained its independence following the war. Though there is still bad blood between Ezo and Japan, the two nations are slowly putting their past behind them. There is a movement to reunify Ezo and Japan into a single nation, but it doesn't have much support at the moment. Still, you never know what the future might hold.
The flag is black and white in reference to the flag of the Tokugawa Shogunate, and the seven-pointed star stands for the spirit of the Ezo people.