In early 2021, China introduced the “30–60” objective of “Carbon Neutral and Carbon Peak,” establishing low-carbon and high-quality development as a pivotal direction for China’s economic and social progress. China’s textile industry assumes a vital role in achieving low-carbon and high-quality development. Technological innovation emerges as a means to meet environmental regulations, facilitating an advantageous synergy between economic prosperity and environmental protection. The purpose of this study is to investigate the relationship between direct environmental regulation (DER) and enterprise innovation in the context of the Chinese textile industry. To achieve it, the study utilizes data collected from publicly listed textile companies in China, covering the period from 2004 to 2018, to construct a moderation-mediation model that explores the complex interplay between DER and enterprise innovation. The study’s novelty lies in comparing the impact of environmental regulation on innovation quality through substantive innovation and green innovation, as well as conducting stratified classification analyses by incorporating heterogeneous factors such as DER intensity, region, and sub-industry. The results demonstrate that DER significantly promotes both the input and output quality of innovation in Chinese textile enterprises, exhibiting a complex pattern of mediating and moderating effects. Specifically, DER exerts a substantial influence on the capital investment in innovation by Chinese textile enterprises, with high-intensity DER yielding more pronounced effects. The impact of DER on enterprise innovation quality is also contingent upon enterprise heterogeneity. Additionally, innovation capital investment serves as a pivotal mediating factor that links DER to the innovation quality of Chinese textile enterprises. The enterprise scale exhibits a moderating effect between DER and enterprise innovation quality. In summary, the mediation of innovation input and the moderation of enterprise scale collectively contribute to a comprehensive moderation-mediation effect on the relationship between DER and innovation quality in Chinese textile enterprises. Based on these findings, this study provides novel empirical support for the narrow “Porter Hypothesis” and offers targeted recommendations for enterprise management and policymakers in future applications.