We developed a model to investigate possible mechanisms underlying the shape of contrast (CRF) and tuning (OT) curves of neurons in the primary visual cortex, V1. We determine analytically the conditions for the structure of the afferent LGN and recurrent V1 inputs that lead to contrast-invariance width of the OT curve and to the nonlinear shape of the CRF. We investigate what are the relative contributions of single neuron and network properties in shaping the OT and the CRF. We test our model with numerical simulations of conductance-based model (CBM). The results indicate that the main effect of a cortex of neurons with accelerating transfer-functions, described here by a power-law, is sharpening. Thus, the OT curves of V1 neurons are more tuned, and their CRF is steeper, than those of their inputs. Last, we show that we are able to account for the heterogeneity in the measured CRFs, by introducing inhomogeneities either in single neuron properties or in the input to the neurons. Correlations among the CRF parameters are different for the different sources for diversity. Comparison with experimental data shows that both sources contribute about equally to heterogeneity in V1.