File size: 3,348 Bytes
6eeb20b |
1 |
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[{"file_id":"1PtimiIJM285j9vE-eUQLPGv_uwKtkWjV","timestamp":1753460744468}],"authorship_tag":"ABX9TyN7ceYXsJzN2dY1FTo5KMoK"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","source":["# @markdown Import list of all Tensor Art posts as 150Mb size .parquet file (SFW only)\n","!pip install -U datasets\n","from datasets import load_dataset\n","ds = load_dataset(\"bigdata-pw/tensorart\")\n"],"metadata":{"id":"ZwwIE7dBOGtt"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# @markdown Browse images on Tensor Art (SFW only)\n","# @markdown <br> <br> Index = 1000*K+N\n","# Example: Access the first item in the dataset (adjust based on dataset structure)\n","\n","from IPython.display import Image, display\n","K= 137 # @param {type:'slider',min:0,max:270}\n","start_at_K = K\n","N = 50 # @param {type:'slider',min:0,max:999}\n","start_at = N\n","travel = 100 # How far we will travel down list in case of misses\n","url =''\n","START_AT = 1000*start_at_K+start_at\n","for index in range(START_AT+travel):\n"," if index<START_AT:continue\n"," item = ds['train'][index]['generationData']\n"," if not item:continue\n"," #---#\n"," prompt=''\n"," url=''\n"," for key in item:\n"," if not item[key]: continue\n"," subitem = item[key]\n"," for subkey in subitem:\n"," #print(subkey)\n"," if subkey=='prompt': prompt=subitem[subkey]\n"," #-----#\n"," #---------#\n"," if prompt != '':\n"," print(f'at index = {index}:')\n"," print('-----')\n"," print(f'{prompt}')\n"," print('------')\n"," try:\n"," image_url = ds['train'][index]['url']\n"," display(Image(url=ds['train'][index]['url'], width=300))\n"," except:\n"," print(\"No image URL found in the variable 'url'.\")\n"," break\n"," #-------#"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":563},"id":"iFyoLiq4Pano","executionInfo":{"status":"ok","timestamp":1753461437931,"user_tz":-120,"elapsed":49,"user":{"displayName":"No Name","userId":"10578412414437288386"}},"outputId":"05995247-6436-4598-f6d2-9d34cb30c32f","cellView":"form"},"execution_count":8,"outputs":[{"output_type":"stream","name":"stdout","text":["at index = 137050:\n","-----\n","(fashion illustration:1.3) Haute couture, no particular features, of high fashion bandana, (extremely close up shot:1.3), || in the style of Izumi Kogahara and Stuart Weitzman ||, Saturated colors, tonal transitions, traces of a wide dry brush, oil paint, high-energy, detailed, iconic, minimalistic, concept art, intricate detail, calligraphic lines. World character design, high-energy, detailed, minimalistic, concept art, in style of Jason Brooks, Soleil Ignacio, Megan Hess, Kerrie Hess, more detail XL, aw0k euphoric style, vintage_p_style, Masterpiece, Fashion Illustration, style,retro ink, glide_fashion, monkren, aw0k euphoric style, PoP art,aesthetic portrait, more detail XL,oil painting,vapor_graphic,Replay1988\n","------\n"]},{"output_type":"display_data","data":{"text/html":["<img src=\"https://image.tensorartassets.com/posts/images/691297453537893792/7c6b5312-8047-4883-97d4-ad19909596d9.jpg\" width=\"300\"/>"],"text/plain":["<IPython.core.display.Image object>"]},"metadata":{}}]}]} |