mirror of
https://github.com/GoogleCloudPlatform/vertex-ai-samples.git
synced 2026-09-26 14:42:04 +00:00
Update notebooks to no-code/low-code (#2860)
This commit is contained in:
+11
-1
@@ -247,7 +247,7 @@
|
||||
"# @markdown * `Civitai`: [Pixel Art XL](https://civitai.com/models/120096/pixel-art-xl). This example downloads LoRA from Civitai, and uploads it to GCS bucket.\n",
|
||||
"# @markdown * `Use your own`: Set your own lora in the next section.\n",
|
||||
"\n",
|
||||
"PRESET_LORA = \"Civitai\" # @param [\"Huggingface\", \"Civitai\", \"Use your own\"]\n",
|
||||
"PRESET_LORA = \"Huggingface\" # @param [\"Huggingface\", \"Civitai\", \"Use your own\"]\n",
|
||||
"\n",
|
||||
"# @markdown [Optional] If you selected `Use your own`, please set your lora source in `CUSTOM_LORA`. It can be one of the following:\n",
|
||||
"# @markdown * A [Hugging Face](https://huggingface.co) lora id\n",
|
||||
@@ -304,6 +304,11 @@
|
||||
"\n",
|
||||
"# @markdown Once deployment succeeds, you can send a batch of text prompts to the endpoint to generated images.\n",
|
||||
"\n",
|
||||
"# @markdown **Note:** Some LoRA adaptors require explicit prompt to activate. For\n",
|
||||
"# @markdown example, the preset Hugging Face [TheLastBen/Papercut_SDXL](https://huggingface.co/TheLastBen/Papercut_SDXL)\n",
|
||||
"# @markdown Lora requires an explicit prompt `\"papercut\"`. In this example,\n",
|
||||
"# @markdown we'll automatically append the prompt for you.\n",
|
||||
"\n",
|
||||
"# @markdown Example:\n",
|
||||
"\n",
|
||||
"# @markdown ```\n",
|
||||
@@ -318,6 +323,11 @@
|
||||
"num_inference_steps = 25 # @param {type:\"number\"}\n",
|
||||
"guidance_scale = 2.5 # @param {type:\"number\"}\n",
|
||||
"\n",
|
||||
"if PRESET_LORA == \"Huggingface\" and \"papercut\" not in prompt:\n",
|
||||
" prompt = \"papercut \" + prompt\n",
|
||||
" print('Adding \"papercut\" to prompt')\n",
|
||||
" print(\"prompt:\", prompt)\n",
|
||||
"\n",
|
||||
"instances = [\n",
|
||||
" {\n",
|
||||
" \"prompt\": prompt,\n",
|
||||
|
||||
Reference in New Issue
Block a user