This question already has an answer here:
Given the scale Lydian in the key of C we can determine that the F# (rather than Gb) is indeed an F# as it doesn't appear elsewhere in the scale.
How can you determine if a note is sharped or flatted if it doesn't exist in the scale? For example if Ab should be a G#?
Does it even make sense to imagine out of scale notes like this or am I thinking about it incorrectly?