diff --git a/inference/sagemaker/byos/stablediffusion_sagemaker_byos.zh.ipynb b/inference/sagemaker/byos/stablediffusion_sagemaker_byos.zh.ipynb index fd0b7e2..7bd7fdc 100644 --- a/inference/sagemaker/byos/stablediffusion_sagemaker_byos.zh.ipynb +++ b/inference/sagemaker/byos/stablediffusion_sagemaker_byos.zh.ipynb @@ -127,7 +127,7 @@ }, "outputs": [], "source": [ - "#model_name = 'andite/anything-v4.0' # 默认的,高品质、高细节的动漫风格\n", + "model_name = 'andite/anything-v4.0' # 默认的,高品质、高细节的动漫风格\n", "#model_name = 'Envvi/Inkpunk-Diffusion' # 温克朋克风格,提示词 nvinkpunk\n", "#model_name = 'nousr/robo-diffusion-2-base' # 看起来很酷的机器人,提示词 nousr robot \n", "#model_name = 'prompthero/openjourney' # openjorney 风格,提示词 mdjrny-v4 style\n", @@ -135,7 +135,7 @@ "#model_name = 'runwayml/stable-diffusion-inpainting'\n", "\n", "#增加 SD Webui Lora 模型加载\n", - "model_name = 'sakistriker/AbyssOrangeMix3'\n", + "#model_name = 'sakistriker/AbyssOrangeMix3'\n", "lora_model = 's3://sagemaker-us-east-1-596030579944/fakemonPokMonLORA/fakemonPokMonLORA_v10Beta.safetensors'\n", "\n", "\n", @@ -147,7 +147,7 @@ " 'SAGEMAKER_MODEL_SERVER_TIMEOUT':'600', \n", " 'SAGEMAKER_MODEL_SERVER_WORKERS': '1', \n", " 'model_name':model_name,\n", - " 'lora_model':lora_model,\n", + " #'lora_model':lora_model,\n", " 's3_bucket':bucket\n", "}" ] @@ -238,7 +238,7 @@ "import uuid\n", "\n", "endpoint_name = f'AIGC-Quick-Kit-{str(uuid.uuid4())}'\n", - "instance_type = 'ml.g4dn.xlarge'\n", + "instance_type = 'ml.g5.xlarge'\n", "instance_count = 1\n", "async_config = AsyncInferenceConfig(output_path='s3://{0}/{1}/asyncinvoke/out/'.format(bucket, 'stablediffusion'))\n", "\n", @@ -392,7 +392,8 @@ "source": [ "#AIGC Quick Kit txt2img\n", "inputs_txt2img = {\n", - " \"prompt\": \"a photo of an astronaut riding a horse on mars\",\n", + " #\"prompt\": \"a photo of an astronaut riding a horse on mars\",\n", + " \"prompt\": \"a photo of robot standing in front a fire, cinematic style\",\n", " \"negative_prompt\":\"\",\n", " \"steps\":20,\n", " \"sampler\":\"euler_a\",\n", @@ -452,43 +453,6 @@ "async_predict_fn(async_predictor,inputs_img2img)" ] }, - { - "cell_type": "markdown", - "id": "d0877bea", - "metadata": {}, - "source": [ - "#### 3.2 LoRA 测试\n", - "测试LoRA 模型" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c350d596", - "metadata": {}, - "outputs": [], - "source": [ - "prompt =\"pokemon,fire, a red wolf with blue eyes\"\n", - "\n", - "\n", - "negative_prompt= \"nsfw, human, 1boy, 1girl,watermark, (worst quality, low quality:1.4), ( jpeg artifacts:1.4), (depth of field, bokeh, blurry, film grain, chromatic aberration, lens flare:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature,\"\n", - "\n", - "inputs_txt2img = {\n", - " \"prompt\": prompt,\n", - " \"negative_prompt\":negative_prompt,\n", - " \"steps\":20,\n", - " \"sampler\":\"euler_a\",\n", - " \"seed\": 52362,\n", - " \"height\": 512, \n", - " \"width\": 512,\n", - " \"count\":2\n", - "\n", - "}\n", - "start=time.time()\n", - "async_predict_fn(async_predictor,inputs_txt2img)\n", - "print(f\"Time taken: {time.time() - start}s\")\n" - ] - }, { "cell_type": "markdown", "id": "5af27f2f",