Aug 19 (Reuters) - U.S. equity funds attracted their biggest weekly inflow in eight weeks in the week to Aug. 17 as strong earnings and hints of a slowing pace of inflation fanned optimism.

According to Refinitiv Lipper data, U.S. equity funds drew $6.85 billion worth of net buying, the most since June 22.

During the reported week, data showed U.S. producer prices declined last month and import prices dipped for the first time in seven months, indicating that U.S. inflation may finally be coming off the boil.

Stronger-than-expected results from Walmart and Home Depot also bolstered views on consumers' ability to spend and lifted sentiment.

U.S. large- and small-cap funds pulled net inflows of $2.13 billion and $1.4 billion, respectively, but mid-cap funds recorded an 11th week of net outflows, this time for $391 million.

Financials and tech saw heavy buying, at a net $1.37 billion and $1.06 billion respectively, while consumer staples attracted a net $516 million.

Investors remained long on bond funds for a third straight week with net purchases of $2.87 billion.

Purchases of U.S. taxable bond funds surged by about 64% from a week ago to a net $2.98 billion but municipal funds recorded a second weekly outflow, of $446 million.

U.S. short/intermediate investment-grade, general domestic taxable fixed income and high-yield bond funds attracted a net $1.41 billion, $1.26 billion and $1.21 billion respectively.

Meanwhile, investors exited short/intermediate government & treasury funds to the tune of $1.67 billion.

Money market funds attracted $1.57 billion worth of net inflows after two consecutive weeks of outflows.

(Reporting by Gaurav Dogra and Patturaja Murugaboopathy in Bengaluru; Editing by Kirsten Donovan)