{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "139e04f1-e66d-410a-8423-aaef457785b9", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Keyword arguments {'trust_remote_code': True} are not expected by WaifuPipeline and will be ignored.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f57750acc1d14f4186566ce22cd1043b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Loading pipeline components...: 0%| | 0/5 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import torch\n", "from diffusers import DiffusionPipeline\n", "from pipeline_waifu import WaifuPipeline\n", "\n", "pipe_id = \"/home/recoilme/models/waifu-2b\"\n", "variant = \"fp16\"\n", "\n", "# Pipeline\n", "pipeline = WaifuPipeline.from_pretrained(\n", " pipe_id,\n", " variant=variant,\n", " trust_remote_code = True\n", ").to(\"cuda\")\n", "#print(pipeline)\n", "\n", "prompt = 'аниме девушка, waifu, يبتسم جنسيا , sur le fond de la tour Eiffel'\n", "generator = torch.Generator(device=\"cuda\").manual_seed(42)\n", "\n", "image = pipeline(\n", " prompt = prompt,\n", " negative_prompt = \"\",\n", " generator=generator,\n", ")[0]\n", "\n", "for img in image:\n", " img.show()\n", " img.save('waifu.png')\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "dbf6aea9-39cf-4b27-9e7d-0c3547aee814", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7169927612b345ce9f574207770a8567", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/20 [00:00