  In 2020, we initiated a systematic study of graph classes in which the
treewidth can only be large due to the presence of a large clique, which we
call $(\mathrm{tw},\omega)$-bounded. While $(\mathrm{tw},\omega)$-bounded graph
classes are known to enjoy some good algorithmic properties related to clique
and coloring problems, it is an interesting open problem whether
$(\mathrm{tw},\omega)$-boundedness also has useful algorithmic implications for
problems related to independent sets.
  We provide a partial answer to this question by means of a new min-max graph
invariant related to tree decompositions. We define the independence number of
a tree decomposition $\mathcal{T}$ of a graph as the maximum independence
number over all subgraphs of $G$ induced by some bag of $\mathcal{T}$. The
tree-independence number of a graph $G$ is then defined as the minimum
independence number over all tree decompositions of $G$. Generalizing a result
on chordal graphs due to Cameron and Hell from 2006, we show that if a graph is
given together with a tree decomposition with bounded independence number, then
the Maximum Weight Independent Packing problem can be solved in polynomial
time.
  Applications of our general algorithmic result to specific graph classes will
be given in the third paper of the series [Dallard, Milani\v{c}, and
\v{S}torgel, Treewidth versus clique number. III. Tree-independence number of
graphs with a forbidden structure].
