Sorption of compressed gases into thin polymeric films is essential for applications including gas sensors and membrane based gas separation. For glassy polymers, the sorption behavior is dependent on the nonequilibrium status of the polymer. The uptake of molecules by a polymer is generally accompanied by dilation, or swelling, of the polymer material. In turn, this dilation can result in penetrant induced plasticization and physical aging that affect the nonequilibrium status of the polymer. Here, we investigate the dilation and sorption behavior of ultrathin membrane layers of a hybrid inorganic-organic network material that consists of alternating polyhedral oligomeric silsesquioxane and imide groups, upon exposure to compressed carbon dioxide and methane. The imide precursor contains fluoroalkene groups that provide affinity toward carbon dioxide, while the octa-functionalized silsesquioxane provides a high degree of cross-linking. This combination allows for extremely high sorption capacities, while structural rearrangements of the network are hindered. We study the simultaneous uptake of gases and dilation of the thin films at high pressures using spectroscopic ellipsometry measurements. Ellipsometry provides the changes in both the refractive index and the film thickness, and allows for accurate quantification of sorption and swelling. In contrast, gravimetric and volumetric measurements only provide a single parameter; this does not allow an accurate correction for, for instance, the changes in buoyancy because of the extensive geometrical changes of highly swelling films. The sorption behavior of the ultrathin hybrid layers depends on the fluoroalkene group content. At low pressure, the apparent molar volume of the gases is low compared to the liquid molar volume of carbon dioxide and methane, respectively. At high gas concentrations in the polymer film, the apparent molar volume of carbon dioxide and methane exceeds that of the liquid molar volume, and approaches that of the gas phase. The high sorption capacity and reversible dilation characteristics of the presented materials provide new directions for applications including gas sensors and gas separation membranes.