Inclusion Criteria:  Main Inclusion Criteria for Patients in Cohorts 1a and 2a:  Age ≥ 18 years. Patients with histologically or cytologically confirmed unresectable stage III or stage IV Cutaneous Melanoma, as per American Joint Committee on Cancer (AJCC) staging system (8th edition). Participation in this trial will be dependent upon supplying tumor tissue from newly obtained specimen. Newly obtained biopsies of a tumor lesion, not previously irradiated, must be provided in the form of excisional biopsies, resected tissue or core needle biopsies. Presence of at least 1 measurable lesion by computed tomography or magnetic resonance imaging per RECIST v1.1 by the local site Investigator / radiologist assessment Presence of at least one lesion amenable to repeated biopsy, ideally not the one being used for measuring. Willingness to undergo a minimum of two fresh lesion biopsies (pre-treatment and on-treatment). Eastern Cooperative Oncology Group (ECOG) performance status 0 to 1. Life expectancy of at least 12 months. Adequate renal, hepatic, and hematologic functions. A female patient is eligible to participate if she is not pregnant, not breastfeeding, and woman of childbearing potential willing to use adequate contraception. A male patient must agree to use adequate contraception.  Main Inclusion Criteria for Patients in Cohort 2b:  Age ≥ 18 years. Histologically or cytologically confirmed stage IV squamous or non-squamous NSCLC without EGFR or ALK /ROS1/RET genomic alteration. Tumor expression with PD-L1 ≥50% tumor proportion score (TPS). First-line treatment-naïve patients. Participation in this trial will be dependent upon supplying tumor tissue from a newly obtained specimen. Newly obtained biopsies of a tumor lesion, not previously irradiated, must be provided in the form of excisional biopsies, resected tissue or core needle biopsies. Presence of at least 1 measurable lesion by computed tomography (CT) or magnetic resonance imaging (MRI) per RECIST v1.1 as determined by the local site Investigator / radiologist assessment. Presence of at least one tumor lesion amenable to repeated biopsy, if possible, ideally not the one being used for measuring. Willingness to undergo a minimum of two fresh tumor biopsies (pre-treatment and on-treatment). ECOG performance status 0 to 1. Life expectancy of at least 6 months. Adequate renal, hepatic, and hematologic functions. A female patient is eligible to participate if she is not pregnant, not breastfeeding, and woman of childbearing potential willing to use adequate contraception. A male patient must agree to use adequate contraception.  Main Exclusion Criteria for patients in all Cohorts:  Currently receiving treatment with another investigational medicinal product. Prior therapy with immune checkpoint inhibitors. Patients must not have received any investigational immunotherapy either. Prior radiotherapy within 2 weeks of enrolment, or within 4 weeks of enrolment in the case of radiation to central nervous system (CNS), which requires ≥ 4-week washout. Prior allogenic tissue or solid organ transplant. Active interstitial lung disease (ILD)/pneumonitis or a history of ILD/pneumonitis requiring treatment with systemic steroids and/or whose pulse oxymetry is less than 92% "on room air". Major surgery within 12 weeks before enrolment. Known additional malignancy that is progressing or requires active treatment, or history of other malignancy within 2 years of study entry. Immunosuppression including the continued use of systemic (at prednisone dose equivalent of > 10 mg) or topical steroids at or near the planned i.m. injection site or the use of immunosuppressive agents for any concurrent condition in the 4 weeks prior to first study treatment administration. Inhaled and eye drop-containing corticosteroids are permitted. Previous vaccination (either therapeutic and/or prophylactic) against cancer. History of autoimmune disease in the last 5 years, including any active autoimmune disease except vitiligo or childhood asthma. Chronic or concurrent active infectious disease requiring systemic antibodies, antifungal, or antiviral treatment. Known Medical History of human immunodeficiency virus (HIV) infection or known Medical History of acquired immunodeficiency syndrome (AIDS). HIV testing is not required unless mandated by the local health authority. Active hepatitis B virus (HBV) or hepatitis C virus (HCV) infection that requires treatment, or at risk for HBV reactivation. Known CNS metastasis and/or carcinomatous meningitis. Known cerebral edema. Live vaccine received within 30 days before treatment initiation.