Since the structures of crystals/molecules are often non-Euclidean data in real space, graph neural networks (GNNs) are regarded as the most prospective approach for their capacity of representing materials by graph-based inputs and emerged as an efficient and powerful tool in accelerating the discovery of new materials. Here, we proposed a self-learning-input GNN framework, named SLI-GNN, to uniformly predict the properties for both crystals and molecules, in which, for the first time, we design a dynamic embedding layer to self-update the input features along with the iteration of the neural network and introduce the Infomax mechanism to maximize the average mutual information between the local features and the global features. It is found that our SLI-GNN can reach ideal prediction accuracy with less inputs and more MPNN layers. The model evaluation on the Materials Project Dataset and QM9 dataset verify that the overall performance of our GNN is comparable to that of other previously reported GNNs. Thus, our GNN framework presents excellent performance in material property prediction, thereby being promising for accelerating the discovery of new materials.