BackgroundData on viral kinetics and variants affecting the duration of viral shedding (VS) were limited. Our objective was to determine VS in distinct SARS-CoV-2 variants, including Omicron BA.4/5 and BF.7, and to identify the relevant influencing factors.MethodsWe carried out a longitudinal cohort study at Beijing Xiaotangshan Fangcang shelter hospital from May to June of 2022 (Omicron BA.4/5) and from November to December of 2022 (Omicron BF.7). Nucleocapsid protein (N) and open reading frame (ORF) genes were considered as the target genes of the reverse transcription-polymerase chain reaction. The daily results of cycle threshold (CT), including lowest ORF1ab-CT values for day1-day3 post of hospitalisation (CT3minORF) and lowest N-CT values for day1-day3 post of hospitalisation (CT3minN), and demographic and clinical characteristics were collected.ResultsA total of 1433 patients with COVID-19 were recruited from Fangcang shelter hospital, in which 278 patients were diagnosed with Omicron BA.4/5 and 1155 patients with Omicron BF.7. Patients with BF.7 infection showed a longer duration of VS. The duration of VS was associated with variants, age, alcohol use, the severity of COVID-19, and CT3minN. Moreover, the nomogram had excellent accuracy in predicting VS.ConclusionsOur results indicated that patients with Omicron BF.7 had a longer period of contagiousness than those with BA.4/5. The duration of VS was affected by a variety of factors and the nomogram may become an applicable clinical instrument to predict VS. Furthermore, we developed a new COVID-19 viral shedding predicting (CVSP) model that can accurately predict the duration of VS for COVID-19 and created a user-friendly website to easily apply this prediction model (https://puh3.shinyapps.io/CVSP_Model/).