- Markdown style
[](https://youtu.be/nTQUwghvy5Q)- HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">| import json | |
| import os | |
| import sys | |
| import requests | |
| MODELS_BASE_DIR = os.path.join("ComfyUI", "models") | |
| def download_file(url, directory, filename, civitai_key=None, hf_token=None): | |
| target_dir = os.path.join(MODELS_BASE_DIR, directory) | |
| os.makedirs(target_dir, exist_ok=True) |
| const url = 'YOUR_API_URL'; | |
| let eventSource = null; | |
| /** | |
| * Generate a 2D image from a sketch | |
| * @param {File} file - The sketch image file | |
| * @param {string} prompt - The prompt for the image generation | |
| * @param {string} negativePrompt - The negative prompt for the image generation | |
| * @returns {string} the path of the generated 2D image |
| public static async Task<MediaAsset> CreateGIF (Texture2D[] textures) { | |
| // Make sure `textures` is not empty | |
| // Make sure every texture has the same size (width and height) | |
| // Make sure every texture has the `TextureFormat.RGBA32` format | |
| // Create recorder | |
| var width = textures[0].width; | |
| var height = textures[0].height; | |
| var frameRate = 5; | |
| var recorder = await MediaRecorder.Create( | |
| MediaFormat.GIF, |
| Kyle K. | |
| Kei H. | |
| kahron s. | |
| Alan H. | |
| Ashita A. | |
| Shahir A. | |
| Moin B. | |
| Mustafa T. | |
| arib k. | |
| Omar K. |
| # %% | |
| import replicate | |
| model = replicate.models.get("prompthero/openjourney") | |
| version = model.versions.get("9936c2001faa2194a261c01381f90e65261879985476014a0a37a334593a05eb") | |
| PROMPT = "mdjrny-v4 style 360 degree equirectangular panorama photograph, Alps, giant mountains, meadows, rivers, rolling hills, trending on artstation, cinematic composition, beautiful lighting, hyper detailed, 8 k, photo, photography" | |
| output = version.predict(prompt=PROMPT, width=1024, height=512) | |
| # %% | |
| # download the iamge from the url at output[0] | |
| import requests |
| using BlendModes; | |
| using UnityEngine; | |
| [RequireComponent(typeof(BlendModeEffect))] | |
| public class SetTextureProperty : MonoBehaviour | |
| { | |
| public Texture2D Texture; | |
| [ContextMenu("Set Texture")] | |
| public void SetTexture () |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "VisualEditor0", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "sagemaker:ListEndpointConfigs", | |
| "sagemaker:DescribeEndpointConfig", | |
| "sagemaker:ListModels", |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace GoogleCloudVision { | |
| [System.Serializable] | |
| public class AnnotateImageRequests | |
| { | |
| public List<AnnotateImageRequest> requests; |
| #import <AVFoundation/AVFoundation.h> | |
| extern "C" { | |
| void _EnableFlashlight(bool enable) { | |
| AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | |
| if ([device hasTorch]) { | |
| [device lockForConfiguration:nil]; | |
| [device setTorchMode:enable ? AVCaptureTorchModeOn : AVCaptureTorchModeOff]; | |
| [device unlockForConfiguration]; |