I think you should compare the qt gui file with the commands. Using gmic cmd, type e.g. for fx_inpaint_patch
gmic e $$fx_inpaint_patch
repeat $! l[$>] if $14 bs={max(16,min(w,h)*arg(1+$14,100,75,50,25,10,5,2,1)%)} at "_fx_inpaint_patch $*",$bs,$bs,1,25%,25%,0,2 else _fx_inpaint_patch $* fi endl done
gmic e $$_fx_inpaint_patch
repeat $! l[$>] R=$9 G=$10 B=$11 A=$12 if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi +round select_color. 0,{round([$R,$G,$B,$A])} if $13 dilate. {1+2*$13} fi inpaint.. [1],$1,{$1*$2},$3,1,{$4*$1},${5-8} rm. endl done
You might see there some intermediate steps and some special handling of parameters! If there are commands you don’t understand do “gmic h <command>”.
Perhaps even better to use the fx_… commands from gmic-qt directly instead of reinventing the wheel by using the gmic base commands. You might get them from the console with verbose output!