This works for me.
if arcpy.Exists("in_memory\\matchtable"):
arcpy.Delete_management("in_memory\\matchtable")
## setup for the attachments
input = r"H:\Documents\ArcGIS\Default.gdb\InstantValues"
inputField = "InstantValues_staname"
matchTable = arcpy.CreateTable_management("in_memory", "matchtable")
matchField = "STATION"
pathField = "Picture"
arcpy.AddField_management(matchTable, matchField, "TEXT")
arcpy.AddField_management(matchTable, pathField, "TEXT")
picFolder = str(outfolder)
## check to see if matchtable exists and remove attachements if it does
fields = ["STATION", "Picture"]
cursor = arcpy.da.InsertCursor(matchTable, fields)
##go thru the picFolder of .png images to attach
for file in os.listdir(picFolder):
if str(file).find(".png") > -1:
pos = int(str(file).find("."))
newfile = str(file)[0:pos]
cursor.insertRow((newfile, file))
del cursor
# the input feature class must first be GDB attachments enabled
arcpy.EnableAttachments_management(input)
# use the match table with the Add Attachments tool
arcpy.AddAttachments_management(input, inputField, matchTable, matchField, pathField, picFolder)
arcpy.AddMessage("Attachments enabled/created")