Sunnah.com : Book 18, Hadith 170
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
وعن ابن عباس رضي الله عنهما قال: سمعت رسول الله صلى الله عليه وسلم يقول: كل مصور في النار يجعل له بكل صورة صورها نفس فيعذبه في جهنم" قال ابن عباس: فإن كنت لابد فاعلا، فاصنع الشجر وما لا ورح فيه" ((متفق عليه))."
Ibn 'Abbas (May Allah be pleased with them) said:
I heard the Messenger of Allah (ﷺ) saying, "Every painter will go to Hell, and for every portrait he has made, there will be appointed one who will chastise him in the Hell." Ibn 'Abbas said: If you have to do it, draw pictures of trees and other inanimate things. [Al-Bukhari and Muslim].
Full reference and source
Sunnah.com : Book 18, Hadith 170 Arabic/English book : Book 18, Hadith 1680
View source on Sunnah.com (opens in a new tab)