permutations=Permutations[{0,0,0,0,1,1,1,1}]

group={
(*面中心*)
{2,3,4,1,6,7,8,5},
{3,4,1,2,7,8,5,6},
{4,1,2,3,8,5,6,7},
{4,3,5,6,8,7,1,2},
{6,5,8,7,2,1,4,3},
{7,8,2,1,3,4,6,5},
{2,8,5,3,6,4,1,7},
{8,7,6,5,4,3,2,1},
{7,1,4,6,3,5,8,2},
(*対角線*)
{1,4,6,7,5,8,2,3},
{1,7,8,2,5,3,4,6},
{3,2,8,5,7,6,4,1},
{8,2,1,7,4,6,5,3},
{8,5,3,2,4,1,7,6},
{6,4,3,5,2,8,7,1},
{3,5,6,4,7,1,2,8},
{6,7,1,4,2,3,5,8},
(*辺中心*)
{2,1,7,8,6,5,3,4},
{5,3,2,8,1,7,6,4},
{5,6,4,3,1,2,8,7},
{4,6,7,1,8,2,3,5},
{7,6,5,8,3,2,1,4},
{5,8,7,6,1,4,3,2},
(*恒等*)
{1,2,3,4,5,6,7,8}
};

permutations[[1]]

Table[i->group[[1,i]],{i,8}]

pattern=Alternatives@@Union[Table[Table[permutations[[1,group[[j,i]]]],{i,8}],{j,24}]]

permutations[[2;;]]

DeleteCases[permutations[[2;;]],pattern]

Length@%

list=permutations;

ret={};

loop=0;

While[list≠{},
obj=First[list];
AppendTo[ret,obj];
list=Rest[list];
pattern=Alternatives@@Union[obj[[#]]&/@group];
list=DeleteCases[list,pattern];
loop++;
]

initial=ret

Length@initial

array[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
ret[[1,2,2]]=sequence[[1]];
ret[[1,1,2]]=sequence[[2]];
ret[[2,1,2]]=sequence[[3]];
ret[[2,2,2]]=sequence[[4]];
ret[[2,1,1]]=sequence[[5]];
ret[[2,2,1]]=sequence[[6]];
ret[[1,2,1]]=sequence[[7]];
ret[[1,1,1]]=sequence[[8]];
Return[ret];
]

array[initial[[1]]]

arrayGraphics3D[array_]:=Block[{n=2},
Graphics3D[
Table[{
Switch[array[[i,j,k]],
0,{FaceForm[Black],Sphere[{i,j,k}+{1/2,1/2,1/2},1/3]},
1,{FaceForm[White],Sphere[{i,j,k}+{1/2,1/2,1/2},1/3]}
]
},
{i,n},{j,n},{k,n}]
]
]

arrayGraphics3D[array[initial[[1]]]]

arrayGraphics3D[array[#]]&/@initial

initial

initial2=initial[[{5,6,1,7,3,4,2}]]

arrayGraphics3D[array[#]]&/@initial2

Tuples[{1,2},3]

array[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
ret[[1,1,1]]=sequence[[8]];
ret[[1,1,2]]=sequence[[2]];
ret[[1,2,1]]=sequence[[7]];
ret[[1,2,2]]=sequence[[1]];
ret[[2,1,1]]=sequence[[5]];
ret[[2,1,2]]=sequence[[3]];
ret[[2,2,1]]=sequence[[6]];
ret[[2,2,2]]=sequence[[4]];
Return[ret];
]

initial3=#[[{8,2,7,1,5,3,6,4}]]&/@initial2

array2[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
ret[[1,1,1]]=sequence[[1]];
ret[[1,1,2]]=sequence[[2]];
ret[[1,2,1]]=sequence[[3]];
ret[[1,2,2]]=sequence[[4]];
ret[[2,1,1]]=sequence[[5]];
ret[[2,1,2]]=sequence[[6]];
ret[[2,2,1]]=sequence[[7]];
ret[[2,2,2]]=sequence[[8]];
Return[ret];
]

arrayGraphics3D[array2[#]]&/@initial3

(arrayGraphics3D[array[#]]&/@initial2)==(arrayGraphics3D[array2[#]]&/@initial3)

array3[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
MapThread[(ret[[Sequence@@#1]]=#2)&,{Tuples[{1,2},3],sequence}];
Return[ret];
]

(arrayGraphics3D[array3[#]]&/@initial3)==(arrayGraphics3D[array2[#]]&/@initial3)

array4[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
MapIndexed[(ret[[Sequence@@#1]]=sequence[[Sequence@@#2]])&,Tuples[{1,2},3]];
Return[ret];
]

array4[sequence_]:=Block[{ret,n=2},
ret=Table[-1,{i,n},{j,n},{k,n}];
MapIndexed[(ret[[Sequence@@#1]]=sequence[[First[#2]]])&,Tuples[{1,2},3]];
Return[ret];
]

(arrayGraphics3D[array4[#]]&/@initial3)==(arrayGraphics3D[array2[#]]&/@initial3)

(*array3にする*)