Photoisomeric supramolecular assemblies have drawn enormous attention in recent years. Although it is a general rule that photoisomerization from a less to a more distorted isomer causes the destruction of assemblies, this photoisomerization process inducing a converse transition from irregular aggregates to regular assemblies is still a great challenge. Here, we report a converse sol-to-gel transition derived from the planar to nonplanar photoisomer conversion, which is in sharp contrast to the conventional light-induced gel collapse. A well-designed acylhydrazone-linked monomer is exploited as a photoisomer to realize the above-mentioned phase transition. In the monomer, imine is responsible for trans - cis interconversion and amide generates intermolecular hydrogen bonds enabling the photoisomerization-driven self-assembly. The counterintuitive feature of the sol-to-gel transition is ascribed to the partial trans → cis photoisomerization of acylhydrazone causing changes in stacking mode of monomers. Furthermore, the reversible phase transition is applied in the valves formed in situ in microfluidic devices, providing fascinating potential for miniature materials.